Author: rooneg
Date: Wed Mar  2 19:11:42 2005
New Revision: 156003

URL: http://svn.apache.org/viewcvs?view=rev&rev=156003
Log:
Add an unoptimized index to the test data and a test to the index tests
that proves we can search it correctly.

* test/data/index-unopt: new test index.

* test/index/index_test.c
  (test_index_term_docs_unopt): new test.
  (test_index): run new test.

Added:
    incubator/lucene4c/trunk/test/data/index-unopt/
    incubator/lucene4c/trunk/test/data/index-unopt/_110.cfs   (with props)
    incubator/lucene4c/trunk/test/data/index-unopt/_143.cfs   (with props)
    incubator/lucene4c/trunk/test/data/index-unopt/_176.cfs   (with props)
    incubator/lucene4c/trunk/test/data/index-unopt/_1a9.cfs   (with props)
    incubator/lucene4c/trunk/test/data/index-unopt/_1dc.cfs   (with props)
    incubator/lucene4c/trunk/test/data/index-unopt/_1gf.cfs   (with props)
    incubator/lucene4c/trunk/test/data/index-unopt/_1ji.cfs   (with props)
    incubator/lucene4c/trunk/test/data/index-unopt/_1ml.cfs   (with props)
    incubator/lucene4c/trunk/test/data/index-unopt/_1mw.cfs   (with props)
    incubator/lucene4c/trunk/test/data/index-unopt/_1n7.cfs   (with props)
    incubator/lucene4c/trunk/test/data/index-unopt/_1ni.cfs   (with props)
    incubator/lucene4c/trunk/test/data/index-unopt/_1nt.cfs   (with props)
    incubator/lucene4c/trunk/test/data/index-unopt/_1o4.cfs   (with props)
    incubator/lucene4c/trunk/test/data/index-unopt/_1of.cfs   (with props)
    incubator/lucene4c/trunk/test/data/index-unopt/_1op.cfs   (with props)
    incubator/lucene4c/trunk/test/data/index-unopt/_uu.cfs   (with props)
    incubator/lucene4c/trunk/test/data/index-unopt/_xx.cfs   (with props)
    incubator/lucene4c/trunk/test/data/index-unopt/deletable   (with props)
    incubator/lucene4c/trunk/test/data/index-unopt/segments   (with props)
Modified:
    incubator/lucene4c/trunk/test/index/index_test.c

Added: incubator/lucene4c/trunk/test/data/index-unopt/_110.cfs
URL: 
http://svn.apache.org/viewcvs/incubator/lucene4c/trunk/test/data/index-unopt/_110.cfs?view=auto&rev=156003
==============================================================================
Binary file - no diff available.

Propchange: incubator/lucene4c/trunk/test/data/index-unopt/_110.cfs
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/lucene4c/trunk/test/data/index-unopt/_143.cfs
URL: 
http://svn.apache.org/viewcvs/incubator/lucene4c/trunk/test/data/index-unopt/_143.cfs?view=auto&rev=156003
==============================================================================
Binary file - no diff available.

Propchange: incubator/lucene4c/trunk/test/data/index-unopt/_143.cfs
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/lucene4c/trunk/test/data/index-unopt/_176.cfs
URL: 
http://svn.apache.org/viewcvs/incubator/lucene4c/trunk/test/data/index-unopt/_176.cfs?view=auto&rev=156003
==============================================================================
Binary file - no diff available.

Propchange: incubator/lucene4c/trunk/test/data/index-unopt/_176.cfs
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/lucene4c/trunk/test/data/index-unopt/_1a9.cfs
URL: 
http://svn.apache.org/viewcvs/incubator/lucene4c/trunk/test/data/index-unopt/_1a9.cfs?view=auto&rev=156003
==============================================================================
Binary file - no diff available.

Propchange: incubator/lucene4c/trunk/test/data/index-unopt/_1a9.cfs
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/lucene4c/trunk/test/data/index-unopt/_1dc.cfs
URL: 
http://svn.apache.org/viewcvs/incubator/lucene4c/trunk/test/data/index-unopt/_1dc.cfs?view=auto&rev=156003
==============================================================================
Binary file - no diff available.

Propchange: incubator/lucene4c/trunk/test/data/index-unopt/_1dc.cfs
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/lucene4c/trunk/test/data/index-unopt/_1gf.cfs
URL: 
http://svn.apache.org/viewcvs/incubator/lucene4c/trunk/test/data/index-unopt/_1gf.cfs?view=auto&rev=156003
==============================================================================
Binary file - no diff available.

Propchange: incubator/lucene4c/trunk/test/data/index-unopt/_1gf.cfs
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/lucene4c/trunk/test/data/index-unopt/_1ji.cfs
URL: 
http://svn.apache.org/viewcvs/incubator/lucene4c/trunk/test/data/index-unopt/_1ji.cfs?view=auto&rev=156003
==============================================================================
Binary file - no diff available.

Propchange: incubator/lucene4c/trunk/test/data/index-unopt/_1ji.cfs
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/lucene4c/trunk/test/data/index-unopt/_1ml.cfs
URL: 
http://svn.apache.org/viewcvs/incubator/lucene4c/trunk/test/data/index-unopt/_1ml.cfs?view=auto&rev=156003
==============================================================================
Binary file - no diff available.

Propchange: incubator/lucene4c/trunk/test/data/index-unopt/_1ml.cfs
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/lucene4c/trunk/test/data/index-unopt/_1mw.cfs
URL: 
http://svn.apache.org/viewcvs/incubator/lucene4c/trunk/test/data/index-unopt/_1mw.cfs?view=auto&rev=156003
==============================================================================
Binary file - no diff available.

Propchange: incubator/lucene4c/trunk/test/data/index-unopt/_1mw.cfs
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/lucene4c/trunk/test/data/index-unopt/_1n7.cfs
URL: 
http://svn.apache.org/viewcvs/incubator/lucene4c/trunk/test/data/index-unopt/_1n7.cfs?view=auto&rev=156003
==============================================================================
Binary file - no diff available.

Propchange: incubator/lucene4c/trunk/test/data/index-unopt/_1n7.cfs
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/lucene4c/trunk/test/data/index-unopt/_1ni.cfs
URL: 
http://svn.apache.org/viewcvs/incubator/lucene4c/trunk/test/data/index-unopt/_1ni.cfs?view=auto&rev=156003
==============================================================================
Binary file - no diff available.

Propchange: incubator/lucene4c/trunk/test/data/index-unopt/_1ni.cfs
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/lucene4c/trunk/test/data/index-unopt/_1nt.cfs
URL: 
http://svn.apache.org/viewcvs/incubator/lucene4c/trunk/test/data/index-unopt/_1nt.cfs?view=auto&rev=156003
==============================================================================
Binary file - no diff available.

Propchange: incubator/lucene4c/trunk/test/data/index-unopt/_1nt.cfs
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/lucene4c/trunk/test/data/index-unopt/_1o4.cfs
URL: 
http://svn.apache.org/viewcvs/incubator/lucene4c/trunk/test/data/index-unopt/_1o4.cfs?view=auto&rev=156003
==============================================================================
Binary file - no diff available.

Propchange: incubator/lucene4c/trunk/test/data/index-unopt/_1o4.cfs
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/lucene4c/trunk/test/data/index-unopt/_1of.cfs
URL: 
http://svn.apache.org/viewcvs/incubator/lucene4c/trunk/test/data/index-unopt/_1of.cfs?view=auto&rev=156003
==============================================================================
Binary file - no diff available.

Propchange: incubator/lucene4c/trunk/test/data/index-unopt/_1of.cfs
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/lucene4c/trunk/test/data/index-unopt/_1op.cfs
URL: 
http://svn.apache.org/viewcvs/incubator/lucene4c/trunk/test/data/index-unopt/_1op.cfs?view=auto&rev=156003
==============================================================================
Binary file - no diff available.

Propchange: incubator/lucene4c/trunk/test/data/index-unopt/_1op.cfs
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/lucene4c/trunk/test/data/index-unopt/_uu.cfs
URL: 
http://svn.apache.org/viewcvs/incubator/lucene4c/trunk/test/data/index-unopt/_uu.cfs?view=auto&rev=156003
==============================================================================
Binary file - no diff available.

Propchange: incubator/lucene4c/trunk/test/data/index-unopt/_uu.cfs
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/lucene4c/trunk/test/data/index-unopt/_xx.cfs
URL: 
http://svn.apache.org/viewcvs/incubator/lucene4c/trunk/test/data/index-unopt/_xx.cfs?view=auto&rev=156003
==============================================================================
Binary file - no diff available.

Propchange: incubator/lucene4c/trunk/test/data/index-unopt/_xx.cfs
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/lucene4c/trunk/test/data/index-unopt/deletable
URL: 
http://svn.apache.org/viewcvs/incubator/lucene4c/trunk/test/data/index-unopt/deletable?view=auto&rev=156003
==============================================================================
Binary file - no diff available.

Propchange: incubator/lucene4c/trunk/test/data/index-unopt/deletable
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/lucene4c/trunk/test/data/index-unopt/segments
URL: 
http://svn.apache.org/viewcvs/incubator/lucene4c/trunk/test/data/index-unopt/segments?view=auto&rev=156003
==============================================================================
Binary file - no diff available.

Propchange: incubator/lucene4c/trunk/test/data/index-unopt/segments
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: incubator/lucene4c/trunk/test/index/index_test.c
URL: 
http://svn.apache.org/viewcvs/incubator/lucene4c/trunk/test/index/index_test.c?view=diff&r1=156002&r2=156003
==============================================================================
--- incubator/lucene4c/trunk/test/index/index_test.c (original)
+++ incubator/lucene4c/trunk/test/index/index_test.c Wed Mar  2 19:11:42 2005
@@ -111,6 +111,63 @@
   apr_pool_clear (p);
 }
 
+static void
+test_index_term_docs_unopt (abts_case *tc, void *data)
+{
+  lcn_term_t *term = lcn_term_create_cstring ("erik", "contents", p);
+  lcn_doc_iter_t *itr;
+  lcn_index_t *idx;
+  lcn_error_t *err;
+  int count = 0;
+
+  CHK_ERR (lcn_index_open (&idx, "test/data/index-unopt", p));
+
+  CHK_ERR (lcn_index_term_docs (&itr, idx, term, p));
+
+  ABTS_INT_EQUAL (tc, 125, lcn_doc_iter_doc (itr));
+
+  while ((err = lcn_doc_iter_next (itr)) == LCN_NO_ERROR)
+    {
+      ++count;
+
+      switch (count)
+        {
+          case 1:
+            ABTS_INT_EQUAL (tc, 133, lcn_doc_iter_doc (itr));
+            break;
+          case 2:
+            ABTS_INT_EQUAL (tc, 266, lcn_doc_iter_doc (itr));
+            break;
+          case 3:
+            ABTS_INT_EQUAL (tc, 274, lcn_doc_iter_doc (itr));
+            break;
+          case 4:
+            ABTS_INT_EQUAL (tc, 31, lcn_doc_iter_doc (itr));
+            break;
+          case 5:
+            ABTS_INT_EQUAL (tc, 39, lcn_doc_iter_doc (itr));
+            break;
+          case 6:
+            ABTS_INT_EQUAL (tc, 40, lcn_doc_iter_doc (itr));
+            break;
+          case 7:
+            ABTS_INT_EQUAL (tc, 56, lcn_doc_iter_doc (itr));
+            break;
+          default:
+            ABTS_TRUE (tc, FALSE);
+            break;
+        }
+    }
+
+  ABTS_INT_EQUAL (tc, APR_EOF, err->apr_err);
+
+  ABTS_INT_EQUAL (tc, 7, count);
+
+  lcn_error_clear (err);
+
+  apr_pool_clear (p);
+}
+
 static const char *path
   = "/Users/rooneg/Hacking/lucene4c/jakarta-lucene/src/demo/CVS/Repository";
 
@@ -161,6 +218,7 @@
   abts_run_test (suite, test_index_max_docs, NULL);
   abts_run_test (suite, test_index_term_docs, NULL);
   abts_run_test (suite, test_index_term_docs_cfs, NULL);
+  abts_run_test (suite, test_index_term_docs_unopt, NULL);
   abts_run_test (suite, test_index_get_document, NULL);
 
   return suite;


Reply via email to