lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject svn commit: r897542 - in /lucene/lucy/trunk/core/Lucy: ./ Test/Index/ Test/Object/ Test/Store/ Test/Util/
Date Sat, 09 Jan 2010 21:02:49 GMT
Author: marvin
Date: Sat Jan  9 21:02:48 2010
New Revision: 897542

URL: http://svn.apache.org/viewvc?rev=897542&view=rev
Log:
Swap out Charmonizer's TestBatch for the new class Lucy::Test::TestBatch.
(LUCY-96).

Added:
    lucene/lucy/trunk/core/Lucy/Test.c   (with props)
Modified:
    lucene/lucy/trunk/core/Lucy/Test.bp
    lucene/lucy/trunk/core/Lucy/Test/Index/TestSegment.c
    lucene/lucy/trunk/core/Lucy/Test/Object/TestBitVector.c
    lucene/lucy/trunk/core/Lucy/Test/Object/TestByteBuf.c
    lucene/lucy/trunk/core/Lucy/Test/Object/TestCharBuf.c
    lucene/lucy/trunk/core/Lucy/Test/Object/TestHash.c
    lucene/lucy/trunk/core/Lucy/Test/Object/TestI32Array.c
    lucene/lucy/trunk/core/Lucy/Test/Object/TestLockFreeRegistry.c
    lucene/lucy/trunk/core/Lucy/Test/Object/TestNum.c
    lucene/lucy/trunk/core/Lucy/Test/Object/TestObj.c
    lucene/lucy/trunk/core/Lucy/Test/Object/TestVArray.c
    lucene/lucy/trunk/core/Lucy/Test/Store/TestCompoundFileReader.c
    lucene/lucy/trunk/core/Lucy/Test/Store/TestCompoundFileWriter.c
    lucene/lucy/trunk/core/Lucy/Test/Store/TestFSDirHandle.c
    lucene/lucy/trunk/core/Lucy/Test/Store/TestFSFileHandle.c
    lucene/lucy/trunk/core/Lucy/Test/Store/TestFSFolder.c
    lucene/lucy/trunk/core/Lucy/Test/Store/TestFileHandle.c
    lucene/lucy/trunk/core/Lucy/Test/Store/TestFolder.c
    lucene/lucy/trunk/core/Lucy/Test/Store/TestIOChunks.c
    lucene/lucy/trunk/core/Lucy/Test/Store/TestIOPrimitives.c
    lucene/lucy/trunk/core/Lucy/Test/Store/TestInStream.c
    lucene/lucy/trunk/core/Lucy/Test/Store/TestRAMDirHandle.c
    lucene/lucy/trunk/core/Lucy/Test/Store/TestRAMFileHandle.c
    lucene/lucy/trunk/core/Lucy/Test/Store/TestRAMFolder.c
    lucene/lucy/trunk/core/Lucy/Test/Util/TestAtomic.c
    lucene/lucy/trunk/core/Lucy/Test/Util/TestIndexFileNames.c
    lucene/lucy/trunk/core/Lucy/Test/Util/TestJson.c
    lucene/lucy/trunk/core/Lucy/Test/Util/TestNumberUtils.c
    lucene/lucy/trunk/core/Lucy/Test/Util/TestPriorityQueue.c
    lucene/lucy/trunk/core/Lucy/Test/Util/TestStringHelper.c

Modified: lucene/lucy/trunk/core/Lucy/Test.bp
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Test.bp?rev=897542&r1=897541&r2=897542&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Test.bp (original)
+++ lucene/lucy/trunk/core/Lucy/Test.bp Sat Jan  9 21:02:48 2010
@@ -1,28 +1,95 @@
 parcel Lucy;
 
-__C__
-#include "Charmonizer/Test.h"
+/** Testing framework.
+ */
+inert class Lucy::Test { }
+
+class Lucy::Test::TestBatch extends Lucy::Object::Obj {
+    int64_t    test_num;
+    int64_t    num_tests;
+    int64_t    num_passed;
+    int64_t    num_failed; 
+    int64_t    num_skipped;
+
+    inert incremented TestBatch*
+    new(int64_t num_tests);
+
+    inert TestBatch*
+    init(TestBatch *self, int64_t num_tests);
+
+    void
+    Plan(TestBatch *self);
+
+    inert bool_t
+    test_true(void *vself, bool_t condition, const char *pattern, ...);
+
+    inert bool_t 
+    test_false(void *vself, bool_t condition, const char *pattern, ...);
+
+    inert bool_t 
+    test_int_equals(void *vself, long got, long expected, 
+                    const char *pattern, ...);
+
+    inert bool_t 
+    test_float_equals(void *vself, double got, double expected,
+                      const char *pattern, ...);
+
+    inert bool_t
+    test_string_equals(void *vself, const char *got, const char *expected,
+                       const char *pattern, ...); 
+
+    inert bool_t 
+    pass(void *vself, const char *pattern, ...);
+
+    inert bool_t 
+    fail(void *vself, const char *pattern, ...);
 
+    inert void
+    skip(void *vself, const char *pattern, ...);
+
+    bool_t 
+    VTest_True(TestBatch *self, bool_t condition, const char *pattern, 
+               va_list args);
+
+    bool_t 
+    VTest_False(TestBatch *self, bool_t condition, const char *pattern, 
+                va_list args);
+
+    bool_t 
+    VTest_Int_Equals(TestBatch *self, long got, long expected, 
+                     const char *pattern, va_list args);
+
+    bool_t 
+    VTest_Float_Equals(TestBatch *self, double got, double expected,
+                       const char *pattern, va_list args);
+
+    bool_t
+    VTest_String_Equals(TestBatch *self, const char *got, const char *expected,
+                       const char *pattern, va_list args); 
+
+    bool_t 
+    VPass(TestBatch *self, const char *pattern, va_list args);
+
+    bool_t 
+    VFail(TestBatch *self, const char *pattern, va_list args);
+
+    void
+    VSkip(TestBatch *self, const char *pattern, va_list args);
+}
+
+__C__
 #ifdef LUCY_USE_SHORT_NAMES
-  #define TestBatch                    chaz_TestBatch
-  #define Test_new_batch               chaz_Test_new_batch
-  #define PLAN                         CHAZ_TEST_PLAN
-  #define PASS                         CHAZ_TEST_PASS
-  #define FAIL                         CHAZ_TEST_FAIL
-  #define ASSERT_TRUE                  CHAZ_TEST_ASSERT_TRUE
-  #define ASSERT_FALSE                 CHAZ_TEST_ASSERT_FALSE
-  #define ASSERT_STR_EQ                CHAZ_TEST_ASSERT_STR_EQ
-  #define ASSERT_STR_NEQ               CHAZ_TEST_ASSERT_STR_NEQ
-  #define ASSERT_INT_EQ                CHAZ_TEST_ASSERT_INT_EQ
-  #define ASSERT_FLOAT_EQ              CHAZ_TEST_ASSERT_FLOAT_EQ
+  #define ASSERT_TRUE                  lucy_TestBatch_test_true
+  #define ASSERT_FALSE                 lucy_TestBatch_test_false
+  #define ASSERT_INT_EQ                lucy_TestBatch_test_int_equals
+  #define ASSERT_FLOAT_EQ              lucy_TestBatch_test_float_equals
+  #define ASSERT_STR_EQ                lucy_TestBatch_test_string_equals
+  #define PASS                         lucy_TestBatch_pass
+  #define FAIL                         lucy_TestBatch_fail
+  #define SKIP                         lucy_TestBatch_skip
 #endif
-  
 __END_C__
 
-/** Testing framework.
- */
-inert class Lucy::Test { }
-
 /* Copyright 2009 The Apache Software Foundation
  *
  * Licensed under the Apache License, Version 2.0 (the "License");

Added: lucene/lucy/trunk/core/Lucy/Test.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Test.c?rev=897542&view=auto
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Test.c (added)
+++ lucene/lucy/trunk/core/Lucy/Test.c Sat Jan  9 21:02:48 2010
@@ -0,0 +1,312 @@
+#include <stdio.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define C_LUCY_TESTBATCH
+#include "Lucy/Util/ToolSet.h"
+
+#include "Lucy/Test.h"
+
+TestBatch*
+TestBatch_new(int64_t num_tests)
+{
+    TestBatch *self = (TestBatch*)VTable_Make_Obj(TESTBATCH);
+    return TestBatch_init(self, num_tests);
+}
+
+TestBatch*
+TestBatch_init(TestBatch *self, int64_t num_tests)
+{
+    /* Assign. */
+    self->num_tests       = num_tests;
+    
+    /* Initialize. */
+    self->test_num        = 0;
+    self->num_passed      = 0;
+    self->num_failed      = 0;
+    self->num_skipped     = 0;
+
+    /* Unbuffer stdout. TODO: move this elsewhere. */
+    int check_val = setvbuf(stdout, NULL, _IONBF, 0);
+    if (check_val != 0) {
+        fprintf(stderr, "Failed when trying to unbuffer stdout\n");
+    }
+
+    return self;
+}
+
+void
+TestBatch_plan(TestBatch *self)
+{
+    printf("1..%" I64P "\n", self->num_tests);
+}
+
+bool_t
+TestBatch_test_true(void *vself, bool_t condition, const char *pattern, ...)
+{
+    va_list args;
+    va_start(args, pattern);
+    bool_t result = TestBatch_VTest_True((TestBatch*)vself, condition, 
+        pattern, args);
+    va_end(args);
+    return result;
+}
+
+bool_t
+TestBatch_test_false(void *vself, bool_t condition, const char *pattern, ...)
+{
+    va_list args;
+    va_start(args, pattern);
+    bool_t result = TestBatch_VTest_False((TestBatch*)vself, condition, 
+        pattern, args);
+    va_end(args);
+    return result;
+}
+
+bool_t
+TestBatch_test_int_equals(void *vself, long got, long expected, 
+                          const char *pattern, ...)
+{
+    va_list args;
+    va_start(args, pattern);
+    bool_t result = TestBatch_VTest_Int_Equals((TestBatch*)vself, got,
+        expected, pattern, args);
+    va_end(args);
+    return result;
+}
+
+bool_t
+TestBatch_test_float_equals(void *vself, double got, double expected, 
+                            const char *pattern, ...)
+{
+    va_list args;
+    va_start(args, pattern);
+    bool_t result = TestBatch_VTest_Float_Equals((TestBatch*)vself, got,
+        expected, pattern, args);
+    va_end(args);
+    return result;
+}
+
+bool_t
+TestBatch_test_string_equals(void *vself, const char *got, 
+                             const char *expected, const char *pattern, ...)
+{
+    va_list args;
+    va_start(args, pattern);
+    bool_t result = TestBatch_VTest_String_Equals((TestBatch*)vself, got,
+        expected, pattern, args);
+    va_end(args);
+    return result;
+}
+
+bool_t
+TestBatch_pass(void *vself, const char *pattern, ...)
+{
+    va_list args;
+    va_start(args, pattern);
+    bool_t result = TestBatch_VPass((TestBatch*)vself, pattern, args);
+    va_end(args);
+    return result;
+}
+
+bool_t
+TestBatch_fail(void *vself, const char *pattern, ...)
+{
+    va_list args;
+    va_start(args, pattern);
+    bool_t result = TestBatch_VFail((TestBatch*)vself, pattern, args);
+    va_end(args);
+    return result;
+}
+
+void
+TestBatch_skip(void *vself, const char *pattern, ...)
+{
+    va_list args;
+    va_start(args, pattern);
+    TestBatch_VSkip((TestBatch*)vself, pattern, args);
+    va_end(args);
+}
+
+bool_t
+TestBatch_vtest_true(TestBatch *self, bool_t condition, const char *pattern, 
+                     va_list args)
+{
+    /* Increment test number. */
+    self->test_num++;
+
+    /* Test condition and pass or fail. */
+    if (condition) {
+        self->num_passed++;
+        printf("ok %" I64P " - ", self->test_num);
+        vprintf(pattern, args);
+        printf("\n");
+        return true;
+    }
+    else {
+        self->num_failed++;
+        printf("not ok %" I64P " - ", self->test_num);
+        vprintf(pattern, args);
+        printf("\n");
+        return false;
+    }
+}
+
+bool_t
+TestBatch_vtest_false(TestBatch *self, bool_t condition, 
+                     const char *pattern, va_list args)
+{
+    /* Increment test number. */
+    self->test_num++;
+
+    /* Test condition and pass or fail. */
+    if (!condition) {
+        self->num_passed++;
+        printf("ok %" I64P " - ", self->test_num);
+        vprintf(pattern, args);
+        printf("\n");
+        return true;
+    }
+    else {
+        self->num_failed++;
+        printf("not ok %" I64P " - ", self->test_num);
+        vprintf(pattern, args);
+        printf("\n");
+        return false;
+    }
+}
+
+bool_t 
+TestBatch_vtest_int_equals(TestBatch *self, long got, long expected, 
+                           const char *pattern, va_list args)
+{
+    /* Increment test number. */
+    self->test_num++;
+
+    /* Test condition and pass or fail. */
+    if (expected == got) {
+        self->num_passed++;
+        printf("ok %" I64P " - ", self->test_num);
+        vprintf(pattern, args);
+        printf("\n");
+        return true;
+    }
+    else {
+        self->num_failed++;
+        printf("not ok %" I64P " - Expected '%ld', got '%ld'\n    ", 
+            self->test_num, expected, got);
+        vprintf(pattern, args);
+        printf("\n");
+        return false;
+    }
+}
+
+bool_t 
+TestBatch_vtest_float_equals(TestBatch *self, double got, double expected, 
+                             const char *pattern, va_list args)
+{
+    double diff = expected/got;
+
+    /* Increment test number. */
+    self->test_num++;
+    
+    /* Evaluate condition and pass or fail. */
+    if (diff > 0.00001) {
+        self->num_passed++;
+        printf("ok %" I64P " - ", self->test_num);
+        vprintf(pattern, args);
+        printf("\n");
+        return true;
+    }
+    else {
+        self->num_failed++;
+        printf("not ok %" I64P " - Expected '%f', got '%f'\n    ", 
+            self->test_num, expected, got);
+        vprintf(pattern, args);
+        printf("\n");
+        return false;
+    }
+}
+
+bool_t 
+TestBatch_vtest_string_equals(TestBatch *self, const char *got, 
+                              const char *expected, const char *pattern, 
+                              va_list args)
+{
+    /* Increment test number. */
+    self->test_num++;
+    
+    /* Test condition and pass or fail. */
+    if (strcmp(expected, got) == 0) {
+        self->num_passed++;
+        printf("ok %" I64P " - ", self->test_num);
+        vprintf(pattern, args);
+        printf("\n");
+        return true;
+    }
+    else {
+        self->num_failed++;
+        printf("not ok %" I64P " - Expected '%s', got '%s'\n    ", 
+            self->test_num, expected, got);
+        vprintf(pattern, args);
+        printf("\n");
+        return false;
+    }
+}
+
+bool_t 
+TestBatch_vpass(TestBatch *self, const char *pattern, va_list args)
+{
+    /* Increment test number. */
+    self->test_num++;
+
+    /* Update counter, indicate pass. */
+    self->num_passed++;
+    printf("ok %" I64P " - ", self->test_num);
+    vprintf(pattern, args);
+    printf("\n");
+
+    return true;
+}
+
+bool_t 
+TestBatch_vfail(TestBatch *self, const char *pattern, va_list args)
+{
+    /* Increment test number. */
+    self->test_num++;
+
+    /* Update counter, indicate failure. */
+    self->num_failed++;
+    printf("not ok %" I64P " - ", self->test_num);
+    vprintf(pattern, args);
+    printf("\n");
+
+    return false;
+}
+
+void
+TestBatch_vskip(TestBatch *self, const char *pattern, va_list args)
+{
+    self->test_num++;
+    printf("ok %" I64P " # SKIP ", self->test_num);
+    vprintf(pattern, args);
+    printf("\n");
+    self->num_skipped++;
+}
+
+/* Copyright 2006-2010 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+

Propchange: lucene/lucy/trunk/core/Lucy/Test.c
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: lucene/lucy/trunk/core/Lucy/Test/Index/TestSegment.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Test/Index/TestSegment.c?rev=897542&r1=897541&r2=897542&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Test/Index/TestSegment.c (original)
+++ lucene/lucy/trunk/core/Lucy/Test/Index/TestSegment.c Sat Jan  9 21:02:48 2010
@@ -138,9 +138,9 @@
 void
 TestSeg_run_tests()
 {
-    TestBatch *batch = Test_new_batch("TestSegment", 21, NULL);
+    TestBatch *batch = TestBatch_new(21);
 
-    PLAN(batch);
+    TestBatch_Plan(batch);
     test_fields(batch);
     test_metadata_storage(batch);
     test_seg_name_and_num(batch);
@@ -148,7 +148,7 @@
     test_Compare_To(batch);
     test_Write_File_and_Read_File(batch);
 
-    batch->destroy(batch);
+    DECREF(batch);
 }
 
 /* Copyright 2009 The Apache Software Foundation

Modified: lucene/lucy/trunk/core/Lucy/Test/Object/TestBitVector.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Test/Object/TestBitVector.c?rev=897542&r1=897541&r2=897542&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Test/Object/TestBitVector.c (original)
+++ lucene/lucy/trunk/core/Lucy/Test/Object/TestBitVector.c Sat Jan  9 21:02:48 2010
@@ -122,7 +122,7 @@
                     if (BitVec_Get(bit_vec, i)) { break; }
                 }
             }
-            ASSERT_INT_EQ(batch, i, 18, "Flip_Block(%d, %d)", offset, len);
+            TEST_I64_EQUALS(batch, i, 18, "Flip_Block(%d, %d)", offset, len);
 
             DECREF(bit_vec);
         }
@@ -437,9 +437,9 @@
 void
 TestBitVector_run_tests()
 {
-    TestBatch   *batch     = Test_new_batch("TestInStream", 1029, NULL);
+    TestBatch   *batch     = TestBatch_new(1029);
 
-    PLAN(batch);
+    TestBatch_Plan(batch);
 
     test_Set_and_Get(batch);
     test_Flip(batch);
@@ -458,7 +458,7 @@
     test_To_Array(batch);
     test_off_by_one_error();
 
-    batch->destroy(batch);
+    DECREF(batch);
 }
 
 /* Copyright 2009 The Apache Software Foundation

Modified: lucene/lucy/trunk/core/Lucy/Test/Object/TestByteBuf.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Test/Object/TestByteBuf.c?rev=897542&r1=897541&r2=897542&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Test/Object/TestByteBuf.c (original)
+++ lucene/lucy/trunk/core/Lucy/Test/Object/TestByteBuf.c Sat Jan  9 21:02:48 2010
@@ -135,8 +135,8 @@
 void
 TestBB_run_tests()
 {
-    TestBatch *batch = Test_new_batch("TestByteBuf", 22, NULL);
-    PLAN(batch);
+    TestBatch *batch = TestBatch_new(22);
+    TestBatch_Plan(batch);
 
     test_Equals(batch);
     test_Grow(batch);
@@ -146,7 +146,7 @@
     test_Cat(batch);
     test_serialization(batch);
 
-    batch->destroy(batch);
+    DECREF(batch);
 }
 
 /* Copyright 2009 The Apache Software Foundation

Modified: lucene/lucy/trunk/core/Lucy/Test/Object/TestCharBuf.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Test/Object/TestCharBuf.c?rev=897542&r1=897541&r2=897542&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Test/Object/TestCharBuf.c (original)
+++ lucene/lucy/trunk/core/Lucy/Test/Object/TestCharBuf.c Sat Jan  9 21:02:48 2010
@@ -365,8 +365,8 @@
 void
 TestCB_run_tests()
 {
-    TestBatch *batch = Test_new_batch("TestCharBuf", 48, NULL);
-    PLAN(batch);
+    TestBatch *batch = TestBatch_new(48);
+    TestBatch_Plan(batch);
 
     test_vcatf_s(batch);
     test_vcatf_null_string(batch);
@@ -391,7 +391,7 @@
     test_To_I64(batch);
     test_serialization(batch);
 
-    batch->destroy(batch);
+    DECREF(batch);
 }
 
 /* Copyright 2009 The Apache Software Foundation

Modified: lucene/lucy/trunk/core/Lucy/Test/Object/TestHash.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Test/Object/TestHash.c?rev=897542&r1=897541&r2=897542&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Test/Object/TestHash.c (original)
+++ lucene/lucy/trunk/core/Lucy/Test/Object/TestHash.c Sat Jan  9 21:02:48 2010
@@ -282,11 +282,11 @@
 void
 TestHash_run_tests()
 {
-    TestBatch *batch = Test_new_batch("TestHash", 29, NULL);
+    TestBatch *batch = TestBatch_new(29);
 
     srand((unsigned int)time((time_t*)NULL));
 
-    PLAN(batch);
+    TestBatch_Plan(batch);
     test_Equals(batch);
     test_Store_and_Fetch(batch);
     test_Keys_Values_Iter(batch);
@@ -294,7 +294,7 @@
     test_serialization(batch);
     test_stress(batch);
 
-    batch->destroy(batch);
+    DECREF(batch);
 }
 
 /* Copyright 2009 The Apache Software Foundation

Modified: lucene/lucy/trunk/core/Lucy/Test/Object/TestI32Array.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Test/Object/TestI32Array.c?rev=897542&r1=897541&r2=897542&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Test/Object/TestI32Array.c (original)
+++ lucene/lucy/trunk/core/Lucy/Test/Object/TestI32Array.c Sat Jan  9 21:02:48 2010
@@ -45,12 +45,12 @@
 void
 TestI32Arr_run_tests()
 {
-    TestBatch *batch = Test_new_batch("TestI32Array", 4, NULL);
+    TestBatch *batch = TestBatch_new(4);
 
-    PLAN(batch);
+    TestBatch_Plan(batch);
     test_all(batch);
 
-    batch->destroy(batch);
+    DECREF(batch);
 }
 
 /* Copyright 2009 The Apache Software Foundation

Modified: lucene/lucy/trunk/core/Lucy/Test/Object/TestLockFreeRegistry.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Test/Object/TestLockFreeRegistry.c?rev=897542&r1=897541&r2=897542&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Test/Object/TestLockFreeRegistry.c (original)
+++ lucene/lucy/trunk/core/Lucy/Test/Object/TestLockFreeRegistry.c Sat Jan  9 21:02:48 2010
@@ -55,12 +55,12 @@
 void
 TestLFReg_run_tests()
 {
-    TestBatch *batch = Test_new_batch("TestLockFreeRegistry", 6, NULL);
+    TestBatch *batch = TestBatch_new(6);
 
-    PLAN(batch);
+    TestBatch_Plan(batch);
     test_all(batch);
 
-    batch->destroy(batch);
+    DECREF(batch);
 }
 
 /* Copyright 2009 The Apache Software Foundation

Modified: lucene/lucy/trunk/core/Lucy/Test/Object/TestNum.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Test/Object/TestNum.c?rev=897542&r1=897541&r2=897542&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Test/Object/TestNum.c (original)
+++ lucene/lucy/trunk/core/Lucy/Test/Object/TestNum.c Sat Jan  9 21:02:48 2010
@@ -202,8 +202,8 @@
 void
 TestNum_run_tests()
 {
-    TestBatch *batch = Test_new_batch("TestNum", 38, NULL);
-    PLAN(batch);
+    TestBatch *batch = TestBatch_new(38);
+    TestBatch_Plan(batch);
 
     test_To_String(batch);
     test_accessors(batch);
@@ -211,7 +211,7 @@
     test_Clone(batch);
     test_serialization(batch);
     
-    batch->destroy(batch);
+    DECREF(batch);
 }
 
 /* Copyright 2009 The Apache Software Foundation

Modified: lucene/lucy/trunk/core/Lucy/Test/Object/TestObj.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Test/Object/TestObj.c?rev=897542&r1=897541&r2=897542&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Test/Object/TestObj.c (original)
+++ lucene/lucy/trunk/core/Lucy/Test/Object/TestObj.c Sat Jan  9 21:02:48 2010
@@ -107,9 +107,9 @@
 void
 TestObj_run_tests()
 {
-    TestBatch *batch = Test_new_batch("TestObj", 12, NULL);
+    TestBatch *batch = TestBatch_new(12);
 
-    PLAN(batch);
+    TestBatch_Plan(batch);
 
     test_refcounts(batch);
     test_To_String(batch);
@@ -118,7 +118,7 @@
     test_Hash_Code(batch);
     test_Is_A(batch);
 
-    batch->destroy(batch);
+    DECREF(batch);
 }
 
 /* Copyright 2009 The Apache Software Foundation

Modified: lucene/lucy/trunk/core/Lucy/Test/Object/TestVArray.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Test/Object/TestVArray.c?rev=897542&r1=897541&r2=897542&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Test/Object/TestVArray.c (original)
+++ lucene/lucy/trunk/core/Lucy/Test/Object/TestVArray.c Sat Jan  9 21:02:48 2010
@@ -265,9 +265,9 @@
 void
 TestVArray_run_tests()
 {
-    TestBatch *batch = Test_new_batch("TestVArray", 39, NULL);
+    TestBatch *batch = TestBatch_new(39);
 
-    PLAN(batch);
+    TestBatch_Plan(batch);
 
     test_Equals(batch);
     test_Store_Fetch(batch);
@@ -280,7 +280,7 @@
     test_Dump_and_Load(batch);
     test_serialization(batch);
 
-    batch->destroy(batch);
+    DECREF(batch);
 }
 
 /* Copyright 2009 The Apache Software Foundation

Modified: lucene/lucy/trunk/core/Lucy/Test/Store/TestCompoundFileReader.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Test/Store/TestCompoundFileReader.c?rev=897542&r1=897541&r2=897542&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Test/Store/TestCompoundFileReader.c (original)
+++ lucene/lucy/trunk/core/Lucy/Test/Store/TestCompoundFileReader.c Sat Jan  9 21:02:48 2010
@@ -324,9 +324,9 @@
 void
 TestCFReader_run_tests()
 {
-    TestBatch *batch = Test_new_batch("TestCompoundFileReader", 48, NULL);
+    TestBatch *batch = TestBatch_new(48);
 
-    PLAN(batch);
+    TestBatch_Plan(batch);
     test_open(batch);
     test_Local_MkDir_and_Find_Folder(batch);
     test_Local_Delete_and_Exists(batch);
@@ -335,7 +335,7 @@
     test_Local_Open_In(batch);
     test_Close(batch);
 
-    batch->destroy(batch);
+    DECREF(batch);
 }
 
 /* Copyright 2009 The Apache Software Foundation

Modified: lucene/lucy/trunk/core/Lucy/Test/Store/TestCompoundFileWriter.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Test/Store/TestCompoundFileWriter.c?rev=897542&r1=897541&r2=897542&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Test/Store/TestCompoundFileWriter.c (original)
+++ lucene/lucy/trunk/core/Lucy/Test/Store/TestCompoundFileWriter.c Sat Jan  9 21:02:48 2010
@@ -109,13 +109,13 @@
 void
 TestCFWriter_run_tests()
 {
-    TestBatch *batch = Test_new_batch("TestCompoundFileWriter", 7, NULL);
+    TestBatch *batch = TestBatch_new(7);
 
-    PLAN(batch);
+    TestBatch_Plan(batch);
     test_Consolidate(batch);
     test_offsets(batch);
 
-    batch->destroy(batch);
+    DECREF(batch);
 }
 
 /* Copyright 2009 The Apache Software Foundation

Modified: lucene/lucy/trunk/core/Lucy/Test/Store/TestFSDirHandle.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Test/Store/TestFSDirHandle.c?rev=897542&r1=897541&r2=897542&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Test/Store/TestFSDirHandle.c (original)
+++ lucene/lucy/trunk/core/Lucy/Test/Store/TestFSDirHandle.c Sat Jan  9 21:02:48 2010
@@ -75,12 +75,12 @@
 void
 TestFSDH_run_tests()
 {
-    TestBatch *batch = Test_new_batch("TestFSDirHandle", 5, NULL);
+    TestBatch *batch = TestBatch_new(5);
 
-    PLAN(batch);
+    TestBatch_Plan(batch);
     test_all(batch);
 
-    batch->destroy(batch);
+    DECREF(batch);
 }
 
 /* Copyright 2009 The Apache Software Foundation

Modified: lucene/lucy/trunk/core/Lucy/Test/Store/TestFSFileHandle.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Test/Store/TestFSFileHandle.c?rev=897542&r1=897541&r2=897542&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Test/Store/TestFSFileHandle.c (original)
+++ lucene/lucy/trunk/core/Lucy/Test/Store/TestFSFileHandle.c Sat Jan  9 21:02:48 2010
@@ -224,15 +224,15 @@
 void
 TestFSFH_run_tests()
 {
-    TestBatch *batch = Test_new_batch("TestFSFileHandle", 46, NULL);
+    TestBatch *batch = TestBatch_new(46);
 
-    PLAN(batch);
+    TestBatch_Plan(batch);
     test_open(batch);
     test_Read_Write(batch);
     test_Close(batch);
     test_Window(batch);
 
-    batch->destroy(batch);
+    DECREF(batch);
 }
 
 /* Copyright 2009 The Apache Software Foundation

Modified: lucene/lucy/trunk/core/Lucy/Test/Store/TestFSFolder.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Test/Store/TestFSFolder.c?rev=897542&r1=897541&r2=897542&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Test/Store/TestFSFolder.c (original)
+++ lucene/lucy/trunk/core/Lucy/Test/Store/TestFSFolder.c Sat Jan  9 21:02:48 2010
@@ -64,13 +64,13 @@
 TestFSFolder_run_tests()
 {
     u32_t num_tests = TestFolderCommon_num_tests() + 3;
-    TestBatch *batch = Test_new_batch("TestFSFolder", num_tests, NULL);
+    TestBatch *batch = TestBatch_new(num_tests);
 
-    PLAN(batch);
+    TestBatch_Plan(batch);
     test_Initialize_and_Check(batch);
     TestFolderCommon_run_tests(batch, S_set_up, S_tear_down);
 
-    batch->destroy(batch);
+    DECREF(batch);
 }
 
 /* Copyright 2009 The Apache Software Foundation

Modified: lucene/lucy/trunk/core/Lucy/Test/Store/TestFileHandle.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Test/Store/TestFileHandle.c?rev=897542&r1=897541&r2=897542&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Test/Store/TestFileHandle.c (original)
+++ lucene/lucy/trunk/core/Lucy/Test/Store/TestFileHandle.c Sat Jan  9 21:02:48 2010
@@ -31,18 +31,18 @@
 void
 TestFH_run_tests()
 {
-    TestBatch     *batch  = Test_new_batch("TestFileHandle", 2, NULL);
+    TestBatch     *batch  = TestBatch_new(2);
     FileHandle    *fh     = S_new_filehandle();
     ZombieCharBuf  foo    = ZCB_LITERAL("foo");
 
-    PLAN(batch);
+    TestBatch_Plan(batch);
 
     ASSERT_TRUE(batch, CB_Equals_Str(FH_Get_Path(fh), "", 0), "Get_Path");
     FH_Set_Path(fh, (CharBuf*)&foo);
     ASSERT_TRUE(batch, CB_Equals(FH_Get_Path(fh), (Obj*)&foo), "Set_Path");
 
     DECREF(fh);
-    batch->destroy(batch);
+    DECREF(batch);
 }
 
 /* Copyright 2009 The Apache Software Foundation

Modified: lucene/lucy/trunk/core/Lucy/Test/Store/TestFolder.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Test/Store/TestFolder.c?rev=897542&r1=897541&r2=897542&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Test/Store/TestFolder.c (original)
+++ lucene/lucy/trunk/core/Lucy/Test/Store/TestFolder.c Sat Jan  9 21:02:48 2010
@@ -470,9 +470,9 @@
 void
 TestFolder_run_tests()
 {
-    TestBatch *batch = Test_new_batch("TestFolder", 74, NULL);
+    TestBatch *batch = TestBatch_new(74);
 
-    PLAN(batch);
+    TestBatch_Plan(batch);
     test_Exists(batch);
     test_Set_Path_and_Get_Path(batch);
     test_MkDir(batch);
@@ -486,7 +486,7 @@
     test_Delete_Tree(batch);
     test_Slurp_File(batch);
 
-    batch->destroy(batch);
+    DECREF(batch);
 }
 
 /* Copyright 2009 The Apache Software Foundation

Modified: lucene/lucy/trunk/core/Lucy/Test/Store/TestIOChunks.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Test/Store/TestIOChunks.c?rev=897542&r1=897541&r2=897542&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Test/Store/TestIOChunks.c (original)
+++ lucene/lucy/trunk/core/Lucy/Test/Store/TestIOChunks.c Sat Jan  9 21:02:48 2010
@@ -81,15 +81,15 @@
 void
 TestIOChunks_run_tests()
 {
-    TestBatch   *batch     = Test_new_batch("TestIOChunks", 5, NULL);
+    TestBatch   *batch     = TestBatch_new(5);
 
     srand((unsigned int)time((time_t*)NULL));
-    PLAN(batch);
+    TestBatch_Plan(batch);
 
     test_Read_Write_Bytes(batch);
     test_Buf(batch);
     
-    batch->destroy(batch);
+    DECREF(batch);
 }
 
 /* Copyright 2009 The Apache Software Foundation

Modified: lucene/lucy/trunk/core/Lucy/Test/Store/TestIOPrimitives.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Test/Store/TestIOPrimitives.c?rev=897542&r1=897541&r2=897542&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Test/Store/TestIOPrimitives.c (original)
+++ lucene/lucy/trunk/core/Lucy/Test/Store/TestIOPrimitives.c Sat Jan  9 21:02:48 2010
@@ -406,10 +406,10 @@
 void
 TestIOPrimitives_run_tests()
 {
-    TestBatch   *batch     = Test_new_batch("TestIOPrimitives", 11, NULL);
+    TestBatch   *batch     = TestBatch_new(11);
 
     srand((unsigned int)time((time_t*)NULL));
-    PLAN(batch);
+    TestBatch_Plan(batch);
 
     test_i8(batch);
     test_u8(batch);
@@ -422,7 +422,7 @@
     test_f32(batch);
     test_f64(batch);
     
-    batch->destroy(batch);
+    DECREF(batch);
 }
 
 /* Copyright 2009 The Apache Software Foundation

Modified: lucene/lucy/trunk/core/Lucy/Test/Store/TestInStream.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Test/Store/TestInStream.c?rev=897542&r1=897541&r2=897542&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Test/Store/TestInStream.c (original)
+++ lucene/lucy/trunk/core/Lucy/Test/Store/TestInStream.c Sat Jan  9 21:02:48 2010
@@ -193,16 +193,16 @@
 void
 TestInStream_run_tests()
 {
-    TestBatch   *batch     = Test_new_batch("TestInStream", 37, NULL);
+    TestBatch   *batch     = TestBatch_new(37);
 
-    PLAN(batch);
+    TestBatch_Plan(batch);
 
     test_refill(batch);
     test_Clone_and_Reopen(batch);
     test_Close(batch);
     test_Seek_and_Tell(batch);
     
-    batch->destroy(batch);
+    DECREF(batch);
 }
 
 /* Copyright 2009 The Apache Software Foundation

Modified: lucene/lucy/trunk/core/Lucy/Test/Store/TestRAMDirHandle.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Test/Store/TestRAMDirHandle.c?rev=897542&r1=897541&r2=897542&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Test/Store/TestRAMDirHandle.c (original)
+++ lucene/lucy/trunk/core/Lucy/Test/Store/TestRAMDirHandle.c Sat Jan  9 21:02:48 2010
@@ -67,12 +67,12 @@
 void
 TestRAMDH_run_tests()
 {
-    TestBatch *batch = Test_new_batch("TestRAMDirHandle", 6, NULL);
+    TestBatch *batch = TestBatch_new(6);
 
-    PLAN(batch);
+    TestBatch_Plan(batch);
     test_all(batch);
 
-    batch->destroy(batch);
+    DECREF(batch);
 }
 
 /* Copyright 2009 The Apache Software Foundation

Modified: lucene/lucy/trunk/core/Lucy/Test/Store/TestRAMFileHandle.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Test/Store/TestRAMFileHandle.c?rev=897542&r1=897541&r2=897542&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Test/Store/TestRAMFileHandle.c (original)
+++ lucene/lucy/trunk/core/Lucy/Test/Store/TestRAMFileHandle.c Sat Jan  9 21:02:48 2010
@@ -149,16 +149,16 @@
 void
 TestRAMFH_run_tests()
 {
-    TestBatch *batch = Test_new_batch("TestRAMFileHandle", 32, NULL);
+    TestBatch *batch = TestBatch_new(32);
 
-    PLAN(batch);
+    TestBatch_Plan(batch);
     test_open(batch);
     test_Read_Write(batch);
     test_Grow_and_Get_File(batch);
     test_Close(batch);
     test_Window(batch);
 
-    batch->destroy(batch);
+    DECREF(batch);
 }
 
 /* Copyright 2009 The Apache Software Foundation

Modified: lucene/lucy/trunk/core/Lucy/Test/Store/TestRAMFolder.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Test/Store/TestRAMFolder.c?rev=897542&r1=897541&r2=897542&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Test/Store/TestRAMFolder.c (original)
+++ lucene/lucy/trunk/core/Lucy/Test/Store/TestRAMFolder.c Sat Jan  9 21:02:48 2010
@@ -461,9 +461,9 @@
 void
 TestRAMFolder_run_tests()
 {
-    TestBatch *batch = Test_new_batch("TestRAMFolder", 98, NULL);
+    TestBatch *batch = TestBatch_new(98);
 
-    PLAN(batch);
+    TestBatch_Plan(batch);
     test_Initialize_and_Check(batch);
     test_Local_Exists(batch);
     test_Local_Is_Directory(batch);
@@ -476,7 +476,7 @@
     test_Hard_Link(batch);
     test_Close(batch);
 
-    batch->destroy(batch);
+    DECREF(batch);
 }
 
 /* Copyright 2009 The Apache Software Foundation

Modified: lucene/lucy/trunk/core/Lucy/Test/Util/TestAtomic.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Test/Util/TestAtomic.c?rev=897542&r1=897541&r2=897542&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Test/Util/TestAtomic.c (original)
+++ lucene/lucy/trunk/core/Lucy/Test/Util/TestAtomic.c Sat Jan  9 21:02:48 2010
@@ -35,13 +35,13 @@
 void
 TestAtomic_run_tests()
 {
-    TestBatch *batch = Test_new_batch("TestAtomic", 6, NULL);
+    TestBatch *batch = TestBatch_new(6);
 
-    PLAN(batch);
+    TestBatch_Plan(batch);
 
     test_cas_ptr(batch);
 
-    batch->destroy(batch);
+    DECREF(batch);
 }
 
 /* Copyright 2009 The Apache Software Foundation

Modified: lucene/lucy/trunk/core/Lucy/Test/Util/TestIndexFileNames.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Test/Util/TestIndexFileNames.c?rev=897542&r1=897541&r2=897542&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Test/Util/TestIndexFileNames.c (original)
+++ lucene/lucy/trunk/core/Lucy/Test/Util/TestIndexFileNames.c Sat Jan  9 21:02:48 2010
@@ -61,14 +61,14 @@
 void
 TestIxFileNames_run_tests()
 {
-    TestBatch *batch = Test_new_batch("TestIndexFileNames", 10, NULL);
+    TestBatch *batch = TestBatch_new(10);
 
-    PLAN(batch);
+    TestBatch_Plan(batch);
 
     test_local_part(batch);
     test_extract_gen(batch);
 
-    batch->destroy(batch);
+    DECREF(batch);
 }
 
 /* Copyright 2009 The Apache Software Foundation

Modified: lucene/lucy/trunk/core/Lucy/Test/Util/TestJson.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Test/Util/TestJson.c?rev=897542&r1=897541&r2=897542&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Test/Util/TestJson.c (original)
+++ lucene/lucy/trunk/core/Lucy/Test/Util/TestJson.c Sat Jan  9 21:02:48 2010
@@ -87,13 +87,13 @@
 void
 TestJson_run_tests()
 {
-    TestBatch *batch = Test_new_batch("TestJson", 10, NULL);
+    TestBatch *batch = TestBatch_new(10);
 
-    PLAN(batch);
+    TestBatch_Plan(batch);
     test_to_and_from(batch);
     test_spew_and_slurp(batch);
 
-    batch->destroy(batch);
+    DECREF(batch);
 }
 
 /* Copyright 2009 The Apache Software Foundation

Modified: lucene/lucy/trunk/core/Lucy/Test/Util/TestNumberUtils.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Test/Util/TestNumberUtils.c?rev=897542&r1=897541&r2=897542&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Test/Util/TestNumberUtils.c (original)
+++ lucene/lucy/trunk/core/Lucy/Test/Util/TestNumberUtils.c Sat Jan  9 21:02:48 2010
@@ -352,9 +352,9 @@
 void
 TestNumUtil_run_tests()
 {
-    TestBatch *batch = Test_new_batch("TestNumberUtils", 1196, NULL);
+    TestBatch *batch = TestBatch_new(1196);
 
-    PLAN(batch);
+    TestBatch_Plan(batch);
     srand((unsigned int)time((time_t*)NULL));
 
     test_u1(batch);
@@ -368,7 +368,7 @@
     test_bigend_f32(batch);
     test_bigend_f64(batch);
 
-    batch->destroy(batch);
+    DECREF(batch);
 }
 
 

Modified: lucene/lucy/trunk/core/Lucy/Test/Util/TestPriorityQueue.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Test/Util/TestPriorityQueue.c?rev=897542&r1=897541&r2=897542&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Test/Util/TestPriorityQueue.c (original)
+++ lucene/lucy/trunk/core/Lucy/Test/Util/TestPriorityQueue.c Sat Jan  9 21:02:48 2010
@@ -142,16 +142,16 @@
 void
 TestPriQ_run_tests()
 {
-    TestBatch   *batch     = Test_new_batch("TestPriQ", 17, NULL);
+    TestBatch   *batch     = TestBatch_new(17);
 
-    PLAN(batch);
+    TestBatch_Plan(batch);
 
     test_Peek_and_Pop_All(batch);
     test_Insert_and_Pop(batch);
     test_discard(batch);
     test_random_insertion(batch);
 
-    batch->destroy(batch);
+    DECREF(batch);
 }
 
 

Modified: lucene/lucy/trunk/core/Lucy/Test/Util/TestStringHelper.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Test/Util/TestStringHelper.c?rev=897542&r1=897541&r2=897542&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Test/Util/TestStringHelper.c (original)
+++ lucene/lucy/trunk/core/Lucy/Test/Util/TestStringHelper.c Sat Jan  9 21:02:48 2010
@@ -214,9 +214,9 @@
 void
 TestStrHelp_run_tests()
 {
-    TestBatch *batch = Test_new_batch("TestStringHelper", 552, NULL);
+    TestBatch *batch = TestBatch_new(552);
 
-    PLAN(batch);
+    TestBatch_Plan(batch);
 
     test_SKIP_and_TRAILING(batch);
     test_overlap(batch);
@@ -226,7 +226,7 @@
     test_back_utf8_char(batch);
     test_invalid_utf8(batch);
 
-    batch->destroy(batch);
+    DECREF(batch);
 }
 
 



Mime
View raw message