You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by nw...@apache.org on 2013/06/24 23:36:57 UTC
[lucy-commits] [05/15] Separate Clownfish from Lucy
http://git-wip-us.apache.org/repos/asf/lucy/blob/d31a7233/core/Clownfish/Test/TestByteBuf.c
----------------------------------------------------------------------
diff --git a/core/Clownfish/Test/TestByteBuf.c b/core/Clownfish/Test/TestByteBuf.c
deleted file mode 100644
index 159a8db..0000000
--- a/core/Clownfish/Test/TestByteBuf.c
+++ /dev/null
@@ -1,156 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-
-#include <string.h>
-
-#define CFISH_USE_SHORT_NAMES
-#define TESTCFISH_USE_SHORT_NAMES
-
-#include "Clownfish/Test/TestByteBuf.h"
-
-#include "Clownfish/ByteBuf.h"
-#include "Clownfish/Test.h"
-#include "Clownfish/TestHarness/TestBatchRunner.h"
-#include "Clownfish/TestHarness/TestUtils.h"
-#include "Clownfish/VTable.h"
-
-TestByteBuf*
-TestBB_new() {
- return (TestByteBuf*)VTable_Make_Obj(TESTBYTEBUF);
-}
-
-static void
-test_Equals(TestBatchRunner *runner) {
- ByteBuf *wanted = BB_new_bytes("foo", 4); // Include terminating NULL.
- ByteBuf *got = BB_new_bytes("foo", 4);
-
- TEST_TRUE(runner, BB_Equals(wanted, (Obj*)got), "Equals");
- TEST_INT_EQ(runner, BB_Hash_Sum(got), BB_Hash_Sum(wanted), "Hash_Sum");
-
- TEST_TRUE(runner, BB_Equals_Bytes(got, "foo", 4), "Equals_Bytes");
- TEST_FALSE(runner, BB_Equals_Bytes(got, "foo", 3),
- "Equals_Bytes spoiled by different size");
- TEST_FALSE(runner, BB_Equals_Bytes(got, "bar", 4),
- "Equals_Bytes spoiled by different content");
-
- BB_Set_Size(got, 3);
- TEST_FALSE(runner, BB_Equals(wanted, (Obj*)got),
- "Different size spoils Equals");
- TEST_FALSE(runner, BB_Hash_Sum(got) == BB_Hash_Sum(wanted),
- "Different size spoils Hash_Sum (probably -- at least this one)");
-
- BB_Mimic_Bytes(got, "bar", 4);
- TEST_INT_EQ(runner, BB_Get_Size(wanted), BB_Get_Size(got),
- "same length");
- TEST_FALSE(runner, BB_Equals(wanted, (Obj*)got),
- "Different content spoils Equals");
-
- DECREF(got);
- DECREF(wanted);
-}
-
-static void
-test_Grow(TestBatchRunner *runner) {
- ByteBuf *bb = BB_new(1);
- TEST_INT_EQ(runner, BB_Get_Capacity(bb), 8,
- "Allocate in 8-byte increments");
- BB_Grow(bb, 9);
- TEST_INT_EQ(runner, BB_Get_Capacity(bb), 16,
- "Grow in 8-byte increments");
- DECREF(bb);
-}
-
-static void
-test_Clone(TestBatchRunner *runner) {
- ByteBuf *bb = BB_new_bytes("foo", 3);
- ByteBuf *twin = BB_Clone(bb);
- TEST_TRUE(runner, BB_Equals(bb, (Obj*)twin), "Clone");
- DECREF(bb);
- DECREF(twin);
-}
-
-static void
-test_compare(TestBatchRunner *runner) {
- ByteBuf *a = BB_new_bytes("foo\0a", 5);
- ByteBuf *b = BB_new_bytes("foo\0b", 5);
-
- BB_Set_Size(a, 4);
- BB_Set_Size(b, 4);
- TEST_INT_EQ(runner, BB_compare(&a, &b), 0,
- "BB_compare returns 0 for equal ByteBufs");
-
- BB_Set_Size(a, 3);
- TEST_TRUE(runner, BB_compare(&a, &b) < 0, "shorter ByteBuf sorts first");
-
- BB_Set_Size(a, 5);
- BB_Set_Size(b, 5);
- TEST_TRUE(runner, BB_compare(&a, &b) < 0,
- "NULL doesn't interfere with BB_compare");
-
- DECREF(a);
- DECREF(b);
-}
-
-static void
-test_Mimic(TestBatchRunner *runner) {
- ByteBuf *a = BB_new_bytes("foo", 3);
- ByteBuf *b = BB_new(0);
-
- BB_Mimic(b, (Obj*)a);
- TEST_TRUE(runner, BB_Equals(a, (Obj*)b), "Mimic");
-
- BB_Mimic_Bytes(a, "bar", 4);
- TEST_TRUE(runner, strcmp(BB_Get_Buf(a), "bar") == 0,
- "Mimic_Bytes content");
- TEST_INT_EQ(runner, BB_Get_Size(a), 4, "Mimic_Bytes size");
-
- BB_Mimic(b, (Obj*)a);
- TEST_TRUE(runner, BB_Equals(a, (Obj*)b), "Mimic");
-
- DECREF(a);
- DECREF(b);
-}
-
-static void
-test_Cat(TestBatchRunner *runner) {
- ByteBuf *wanted = BB_new_bytes("foobar", 6);
- ByteBuf *got = BB_new_bytes("foo", 3);
- ByteBuf *scratch = BB_new_bytes("bar", 3);
-
- BB_Cat(got, scratch);
- TEST_TRUE(runner, BB_Equals(wanted, (Obj*)got), "Cat");
-
- BB_Mimic_Bytes(wanted, "foobarbaz", 9);
- BB_Cat_Bytes(got, "baz", 3);
- TEST_TRUE(runner, BB_Equals(wanted, (Obj*)got), "Cat_Bytes");
-
- DECREF(scratch);
- DECREF(got);
- DECREF(wanted);
-}
-
-void
-TestBB_run(TestByteBuf *self, TestBatchRunner *runner) {
- TestBatchRunner_Plan(runner, (TestBatch*)self, 21);
- test_Equals(runner);
- test_Grow(runner);
- test_Clone(runner);
- test_compare(runner);
- test_Mimic(runner);
- test_Cat(runner);
-}
-
-
http://git-wip-us.apache.org/repos/asf/lucy/blob/d31a7233/core/Clownfish/Test/TestByteBuf.cfh
----------------------------------------------------------------------
diff --git a/core/Clownfish/Test/TestByteBuf.cfh b/core/Clownfish/Test/TestByteBuf.cfh
deleted file mode 100644
index 3335c95..0000000
--- a/core/Clownfish/Test/TestByteBuf.cfh
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-
-parcel TestClownfish;
-
-class Clownfish::Test::TestByteBuf cnick TestBB
- inherits Clownfish::TestHarness::TestBatch {
-
- inert incremented TestByteBuf*
- new();
-
- void
- Run(TestByteBuf *self, TestBatchRunner *runner);
-}
-
-
http://git-wip-us.apache.org/repos/asf/lucy/blob/d31a7233/core/Clownfish/Test/TestCharBuf.c
----------------------------------------------------------------------
diff --git a/core/Clownfish/Test/TestCharBuf.c b/core/Clownfish/Test/TestCharBuf.c
deleted file mode 100644
index 5b2fdf4..0000000
--- a/core/Clownfish/Test/TestCharBuf.c
+++ /dev/null
@@ -1,425 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-
-#include <string.h>
-#include <stdio.h>
-
-#define CHY_USE_SHORT_NAMES
-#define CFISH_USE_SHORT_NAMES
-#define TESTCFISH_USE_SHORT_NAMES
-
-#include "Clownfish/Test/TestCharBuf.h"
-
-#include "Clownfish/CharBuf.h"
-#include "Clownfish/Num.h"
-#include "Clownfish/Test.h"
-#include "Clownfish/TestHarness/TestBatchRunner.h"
-#include "Clownfish/TestHarness/TestUtils.h"
-#include "Clownfish/VTable.h"
-
-static char smiley[] = { (char)0xE2, (char)0x98, (char)0xBA, 0 };
-static uint32_t smiley_len = 3;
-
-TestCharBuf*
-TestCB_new() {
- return (TestCharBuf*)VTable_Make_Obj(TESTCHARBUF);
-}
-
-static CharBuf*
-S_get_cb(const char *string) {
- return CB_new_from_utf8(string, strlen(string));
-}
-
-static void
-test_Cat(TestBatchRunner *runner) {
- CharBuf *wanted = CB_newf("a%s", smiley);
- CharBuf *got = S_get_cb("");
-
- CB_Cat(got, wanted);
- TEST_TRUE(runner, CB_Equals(wanted, (Obj*)got), "Cat");
- DECREF(got);
-
- got = S_get_cb("a");
- CB_Cat_Char(got, 0x263A);
- TEST_TRUE(runner, CB_Equals(wanted, (Obj*)got), "Cat_Char");
- DECREF(got);
-
- got = S_get_cb("a");
- CB_Cat_Str(got, smiley, smiley_len);
- TEST_TRUE(runner, CB_Equals(wanted, (Obj*)got), "Cat_Str");
- DECREF(got);
-
- got = S_get_cb("a");
- CB_Cat_Trusted_Str(got, smiley, smiley_len);
- TEST_TRUE(runner, CB_Equals(wanted, (Obj*)got), "Cat_Trusted_Str");
- DECREF(got);
-
- DECREF(wanted);
-}
-
-static void
-test_Mimic_and_Clone(TestBatchRunner *runner) {
- CharBuf *wanted = S_get_cb("foo");
- CharBuf *got = S_get_cb("bar");
-
- CB_Mimic(got, (Obj*)wanted);
- TEST_TRUE(runner, CB_Equals(wanted, (Obj*)got), "Mimic");
- DECREF(got);
-
- got = S_get_cb("bar");
- CB_Mimic_Str(got, "foo", 3);
- TEST_TRUE(runner, CB_Equals(wanted, (Obj*)got), "Mimic_Str");
- DECREF(got);
-
- got = CB_Clone(wanted);
- TEST_TRUE(runner, CB_Equals(wanted, (Obj*)got), "Clone");
- DECREF(got);
-
- DECREF(wanted);
-}
-
-static void
-test_Find(TestBatchRunner *runner) {
- CharBuf *string = CB_new(10);
- CharBuf *substring = S_get_cb("foo");
-
- TEST_TRUE(runner, CB_Find(string, substring) == -1, "Not in empty string");
- CB_setf(string, "foo");
- TEST_TRUE(runner, CB_Find(string, substring) == 0, "Find complete string");
- CB_setf(string, "afoo");
- TEST_TRUE(runner, CB_Find(string, substring) == 1, "Find after first");
- CB_Set_Size(string, 3);
- TEST_TRUE(runner, CB_Find(string, substring) == -1, "Don't overrun");
- CB_setf(string, "afood");
- TEST_TRUE(runner, CB_Find(string, substring) == 1, "Find in middle");
-
- DECREF(substring);
- DECREF(string);
-}
-
-static void
-test_Code_Point_At_and_From(TestBatchRunner *runner) {
- uint32_t code_points[] = { 'a', 0x263A, 0x263A, 'b', 0x263A, 'c' };
- uint32_t num_code_points = sizeof(code_points) / sizeof(uint32_t);
- CharBuf *string = CB_newf("a%s%sb%sc", smiley, smiley, smiley);
- uint32_t i;
-
- for (i = 0; i < num_code_points; i++) {
- uint32_t from = num_code_points - i - 1;
- TEST_INT_EQ(runner, CB_Code_Point_At(string, i), code_points[i],
- "Code_Point_At %ld", (long)i);
- TEST_INT_EQ(runner, CB_Code_Point_At(string, from),
- code_points[from], "Code_Point_From %ld", (long)from);
- }
-
- DECREF(string);
-}
-
-static void
-test_SubString(TestBatchRunner *runner) {
- CharBuf *string = CB_newf("a%s%sb%sc", smiley, smiley, smiley);
- CharBuf *wanted = CB_newf("%sb%s", smiley, smiley);
- CharBuf *got = CB_SubString(string, 2, 3);
- TEST_TRUE(runner, CB_Equals(wanted, (Obj*)got), "SubString");
- DECREF(wanted);
- DECREF(got);
- DECREF(string);
-}
-
-static void
-test_Nip_and_Chop(TestBatchRunner *runner) {
- CharBuf *wanted;
- CharBuf *got;
-
- wanted = CB_newf("%sb%sc", smiley, smiley);
- got = CB_newf("a%s%sb%sc", smiley, smiley, smiley);
- CB_Nip(got, 2);
- TEST_TRUE(runner, CB_Equals(wanted, (Obj*)got), "Nip");
- DECREF(wanted);
- DECREF(got);
-
- wanted = CB_newf("a%s%s", smiley, smiley);
- got = CB_newf("a%s%sb%sc", smiley, smiley, smiley);
- CB_Chop(got, 3);
- TEST_TRUE(runner, CB_Equals(wanted, (Obj*)got), "Chop");
- DECREF(wanted);
- DECREF(got);
-}
-
-
-static void
-test_Truncate(TestBatchRunner *runner) {
- CharBuf *wanted = CB_newf("a%s", smiley, smiley);
- CharBuf *got = CB_newf("a%s%sb%sc", smiley, smiley, smiley);
- CB_Truncate(got, 2);
- TEST_TRUE(runner, CB_Equals(wanted, (Obj*)got), "Truncate");
- DECREF(wanted);
- DECREF(got);
-}
-
-static void
-test_Trim(TestBatchRunner *runner) {
- uint32_t spaces[] = {
- ' ', '\t', '\r', '\n', 0x000B, 0x000C, 0x000D, 0x0085,
- 0x00A0, 0x1680, 0x180E, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004,
- 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x2028, 0x2029,
- 0x202F, 0x205F, 0x3000
- };
- uint32_t num_spaces = sizeof(spaces) / sizeof(uint32_t);
- uint32_t i;
- CharBuf *got = CB_new(0);
-
- // Surround a smiley with lots of whitespace.
- for (i = 0; i < num_spaces; i++) { CB_Cat_Char(got, spaces[i]); }
- CB_Cat_Char(got, 0x263A);
- for (i = 0; i < num_spaces; i++) { CB_Cat_Char(got, spaces[i]); }
-
- TEST_TRUE(runner, CB_Trim_Top(got), "Trim_Top returns true on success");
- TEST_FALSE(runner, CB_Trim_Top(got),
- "Trim_Top returns false on failure");
- TEST_TRUE(runner, CB_Trim_Tail(got), "Trim_Tail returns true on success");
- TEST_FALSE(runner, CB_Trim_Tail(got),
- "Trim_Tail returns false on failure");
- TEST_TRUE(runner, CB_Equals_Str(got, smiley, smiley_len),
- "Trim_Top and Trim_Tail worked");
-
- // Build the spacey smiley again.
- CB_Truncate(got, 0);
- for (i = 0; i < num_spaces; i++) { CB_Cat_Char(got, spaces[i]); }
- CB_Cat_Char(got, 0x263A);
- for (i = 0; i < num_spaces; i++) { CB_Cat_Char(got, spaces[i]); }
-
- TEST_TRUE(runner, CB_Trim(got), "Trim returns true on success");
- TEST_FALSE(runner, CB_Trim(got), "Trim returns false on failure");
- TEST_TRUE(runner, CB_Equals_Str(got, smiley, smiley_len),
- "Trim worked");
-
- DECREF(got);
-}
-
-static void
-test_To_F64(TestBatchRunner *runner) {
- CharBuf *charbuf = S_get_cb("1.5");
- double difference = 1.5 - CB_To_F64(charbuf);
- if (difference < 0) { difference = 0 - difference; }
- TEST_TRUE(runner, difference < 0.001, "To_F64");
-
- CB_setf(charbuf, "-1.5");
- difference = 1.5 + CB_To_F64(charbuf);
- if (difference < 0) { difference = 0 - difference; }
- TEST_TRUE(runner, difference < 0.001, "To_F64 negative");
-
- CB_setf(charbuf, "1.59");
- double value_full = CB_To_F64(charbuf);
- CB_Set_Size(charbuf, 3);
- double value_short = CB_To_F64(charbuf);
- TEST_TRUE(runner, value_short < value_full,
- "TO_F64 doesn't run past end of string");
-
- DECREF(charbuf);
-}
-
-static void
-test_To_I64(TestBatchRunner *runner) {
- CharBuf *charbuf = S_get_cb("10");
- TEST_TRUE(runner, CB_To_I64(charbuf) == 10, "To_I64");
- CB_setf(charbuf, "-10");
- TEST_TRUE(runner, CB_To_I64(charbuf) == -10, "To_I64 negative");
- DECREF(charbuf);
-}
-
-
-static void
-test_vcatf_s(TestBatchRunner *runner) {
- CharBuf *wanted = S_get_cb("foo bar bizzle baz");
- CharBuf *got = S_get_cb("foo ");
- CB_catf(got, "bar %s baz", "bizzle");
- TEST_TRUE(runner, CB_Equals(wanted, (Obj*)got), "%%s");
- DECREF(wanted);
- DECREF(got);
-}
-
-static void
-test_vcatf_null_string(TestBatchRunner *runner) {
- CharBuf *wanted = S_get_cb("foo bar [NULL] baz");
- CharBuf *got = S_get_cb("foo ");
- CB_catf(got, "bar %s baz", NULL);
- TEST_TRUE(runner, CB_Equals(wanted, (Obj*)got), "%%s NULL");
- DECREF(wanted);
- DECREF(got);
-}
-
-static void
-test_vcatf_cb(TestBatchRunner *runner) {
- CharBuf *wanted = S_get_cb("foo bar ZEKE baz");
- CharBuf *catworthy = S_get_cb("ZEKE");
- CharBuf *got = S_get_cb("foo ");
- CB_catf(got, "bar %o baz", catworthy);
- TEST_TRUE(runner, CB_Equals(wanted, (Obj*)got), "%%o CharBuf");
- DECREF(catworthy);
- DECREF(wanted);
- DECREF(got);
-}
-
-static void
-test_vcatf_obj(TestBatchRunner *runner) {
- CharBuf *wanted = S_get_cb("ooga 20 booga");
- Integer32 *i32 = Int32_new(20);
- CharBuf *got = S_get_cb("ooga");
- CB_catf(got, " %o booga", i32);
- TEST_TRUE(runner, CB_Equals(wanted, (Obj*)got), "%%o Obj");
- DECREF(i32);
- DECREF(wanted);
- DECREF(got);
-}
-
-static void
-test_vcatf_null_obj(TestBatchRunner *runner) {
- CharBuf *wanted = S_get_cb("foo bar [NULL] baz");
- CharBuf *got = S_get_cb("foo ");
- CB_catf(got, "bar %o baz", NULL);
- TEST_TRUE(runner, CB_Equals(wanted, (Obj*)got), "%%o NULL");
- DECREF(wanted);
- DECREF(got);
-}
-
-static void
-test_vcatf_i8(TestBatchRunner *runner) {
- CharBuf *wanted = S_get_cb("foo bar -3 baz");
- int8_t num = -3;
- CharBuf *got = S_get_cb("foo ");
- CB_catf(got, "bar %i8 baz", num);
- TEST_TRUE(runner, CB_Equals(wanted, (Obj*)got), "%%i8");
- DECREF(wanted);
- DECREF(got);
-}
-
-static void
-test_vcatf_i32(TestBatchRunner *runner) {
- CharBuf *wanted = S_get_cb("foo bar -100000 baz");
- int32_t num = -100000;
- CharBuf *got = S_get_cb("foo ");
- CB_catf(got, "bar %i32 baz", num);
- TEST_TRUE(runner, CB_Equals(wanted, (Obj*)got), "%%i32");
- DECREF(wanted);
- DECREF(got);
-}
-
-static void
-test_vcatf_i64(TestBatchRunner *runner) {
- CharBuf *wanted = S_get_cb("foo bar -5000000000 baz");
- int64_t num = INT64_C(-5000000000);
- CharBuf *got = S_get_cb("foo ");
- CB_catf(got, "bar %i64 baz", num);
- TEST_TRUE(runner, CB_Equals(wanted, (Obj*)got), "%%i64");
- DECREF(wanted);
- DECREF(got);
-}
-
-static void
-test_vcatf_u8(TestBatchRunner *runner) {
- CharBuf *wanted = S_get_cb("foo bar 3 baz");
- uint8_t num = 3;
- CharBuf *got = S_get_cb("foo ");
- CB_catf(got, "bar %u8 baz", num);
- TEST_TRUE(runner, CB_Equals(wanted, (Obj*)got), "%%u8");
- DECREF(wanted);
- DECREF(got);
-}
-
-static void
-test_vcatf_u32(TestBatchRunner *runner) {
- CharBuf *wanted = S_get_cb("foo bar 100000 baz");
- uint32_t num = 100000;
- CharBuf *got = S_get_cb("foo ");
- CB_catf(got, "bar %u32 baz", num);
- TEST_TRUE(runner, CB_Equals(wanted, (Obj*)got), "%%u32");
- DECREF(wanted);
- DECREF(got);
-}
-
-static void
-test_vcatf_u64(TestBatchRunner *runner) {
- CharBuf *wanted = S_get_cb("foo bar 5000000000 baz");
- uint64_t num = UINT64_C(5000000000);
- CharBuf *got = S_get_cb("foo ");
- CB_catf(got, "bar %u64 baz", num);
- TEST_TRUE(runner, CB_Equals(wanted, (Obj*)got), "%%u64");
- DECREF(wanted);
- DECREF(got);
-}
-
-static void
-test_vcatf_f64(TestBatchRunner *runner) {
- CharBuf *wanted;
- char buf[64];
- float num = 1.3f;
- CharBuf *got = S_get_cb("foo ");
- sprintf(buf, "foo bar %g baz", num);
- wanted = CB_new_from_trusted_utf8(buf, strlen(buf));
- CB_catf(got, "bar %f64 baz", num);
- TEST_TRUE(runner, CB_Equals(wanted, (Obj*)got), "%%f64");
- DECREF(wanted);
- DECREF(got);
-}
-
-static void
-test_vcatf_x32(TestBatchRunner *runner) {
- CharBuf *wanted;
- char buf[64];
- unsigned long num = INT32_MAX;
- CharBuf *got = S_get_cb("foo ");
-#if (SIZEOF_LONG == 4)
- sprintf(buf, "foo bar %.8lx baz", num);
-#elif (SIZEOF_INT == 4)
- sprintf(buf, "foo bar %.8x baz", (unsigned)num);
-#endif
- wanted = CB_new_from_trusted_utf8(buf, strlen(buf));
- CB_catf(got, "bar %x32 baz", (uint32_t)num);
- TEST_TRUE(runner, CB_Equals(wanted, (Obj*)got), "%%x32");
- DECREF(wanted);
- DECREF(got);
-}
-
-void
-TestCB_run(TestCharBuf *self, TestBatchRunner *runner) {
- TestBatchRunner_Plan(runner, (TestBatch*)self, 54);
- test_vcatf_s(runner);
- test_vcatf_null_string(runner);
- test_vcatf_cb(runner);
- test_vcatf_obj(runner);
- test_vcatf_null_obj(runner);
- test_vcatf_i8(runner);
- test_vcatf_i32(runner);
- test_vcatf_i64(runner);
- test_vcatf_u8(runner);
- test_vcatf_u32(runner);
- test_vcatf_u64(runner);
- test_vcatf_f64(runner);
- test_vcatf_x32(runner);
- test_Cat(runner);
- test_Mimic_and_Clone(runner);
- test_Code_Point_At_and_From(runner);
- test_Find(runner);
- test_SubString(runner);
- test_Nip_and_Chop(runner);
- test_Truncate(runner);
- test_Trim(runner);
- test_To_F64(runner);
- test_To_I64(runner);
-}
-
-
http://git-wip-us.apache.org/repos/asf/lucy/blob/d31a7233/core/Clownfish/Test/TestCharBuf.cfh
----------------------------------------------------------------------
diff --git a/core/Clownfish/Test/TestCharBuf.cfh b/core/Clownfish/Test/TestCharBuf.cfh
deleted file mode 100644
index 3cc5d43..0000000
--- a/core/Clownfish/Test/TestCharBuf.cfh
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-
-parcel TestClownfish;
-
-class Clownfish::Test::TestCharBuf cnick TestCB
- inherits Clownfish::TestHarness::TestBatch {
-
- inert incremented TestCharBuf*
- new();
-
- void
- Run(TestCharBuf *self, TestBatchRunner *runner);
-}
-
-
http://git-wip-us.apache.org/repos/asf/lucy/blob/d31a7233/core/Clownfish/Test/TestErr.c
----------------------------------------------------------------------
diff --git a/core/Clownfish/Test/TestErr.c b/core/Clownfish/Test/TestErr.c
deleted file mode 100644
index ddf0457..0000000
--- a/core/Clownfish/Test/TestErr.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-
-#define CFISH_USE_SHORT_NAMES
-#define TESTCFISH_USE_SHORT_NAMES
-
-#include "Clownfish/Test/TestErr.h"
-
-#include "Clownfish/CharBuf.h"
-#include "Clownfish/Err.h"
-#include "Clownfish/Test.h"
-#include "Clownfish/TestHarness/TestBatchRunner.h"
-#include "Clownfish/VTable.h"
-
-TestErr*
-TestErr_new() {
- return (TestErr*)VTable_Make_Obj(TESTERR);
-}
-
-static void
-test_To_String(TestBatchRunner *runner) {
- CharBuf *message = CB_newf("oops");
- Err *error = Err_new(message);
- CharBuf *string = Err_To_String(error);
- TEST_TRUE(runner, CB_Equals(message, (Obj*)string),
- "Stringifies as message");
- DECREF(string);
- DECREF(error);
-}
-
-void
-TestErr_run(TestErr *self, TestBatchRunner *runner) {
- TestBatchRunner_Plan(runner, (TestBatch*)self, 1);
- test_To_String(runner);
-}
-
-
http://git-wip-us.apache.org/repos/asf/lucy/blob/d31a7233/core/Clownfish/Test/TestErr.cfh
----------------------------------------------------------------------
diff --git a/core/Clownfish/Test/TestErr.cfh b/core/Clownfish/Test/TestErr.cfh
deleted file mode 100644
index 178017c..0000000
--- a/core/Clownfish/Test/TestErr.cfh
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-
-parcel TestClownfish;
-
-class Clownfish::Test::TestErr
- inherits Clownfish::TestHarness::TestBatch {
-
- inert incremented TestErr*
- new();
-
- void
- Run(TestErr *self, TestBatchRunner *runner);
-}
-
http://git-wip-us.apache.org/repos/asf/lucy/blob/d31a7233/core/Clownfish/Test/TestHash.c
----------------------------------------------------------------------
diff --git a/core/Clownfish/Test/TestHash.c b/core/Clownfish/Test/TestHash.c
deleted file mode 100644
index f71203e..0000000
--- a/core/Clownfish/Test/TestHash.c
+++ /dev/null
@@ -1,266 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-
-#include <stdlib.h>
-#include <time.h>
-
-#define CFISH_USE_SHORT_NAMES
-#define TESTCFISH_USE_SHORT_NAMES
-
-#include "Clownfish/Test/TestHash.h"
-
-#include "Clownfish/CharBuf.h"
-#include "Clownfish/Hash.h"
-#include "Clownfish/Num.h"
-#include "Clownfish/Test.h"
-#include "Clownfish/TestHarness/TestBatchRunner.h"
-#include "Clownfish/TestHarness/TestUtils.h"
-#include "Clownfish/VArray.h"
-#include "Clownfish/VTable.h"
-
-TestHash*
-TestHash_new() {
- return (TestHash*)VTable_Make_Obj(TESTHASH);
-}
-
-static void
-test_Equals(TestBatchRunner *runner) {
- Hash *hash = Hash_new(0);
- Hash *other = Hash_new(0);
- ZombieCharBuf *stuff = ZCB_WRAP_STR("stuff", 5);
-
- TEST_TRUE(runner, Hash_Equals(hash, (Obj*)other),
- "Empty hashes are equal");
-
- Hash_Store_Str(hash, "foo", 3, (Obj*)CFISH_TRUE);
- TEST_FALSE(runner, Hash_Equals(hash, (Obj*)other),
- "Add one pair and Equals returns false");
-
- Hash_Store_Str(other, "foo", 3, (Obj*)CFISH_TRUE);
- TEST_TRUE(runner, Hash_Equals(hash, (Obj*)other),
- "Add a matching pair and Equals returns true");
-
- Hash_Store_Str(other, "foo", 3, INCREF(stuff));
- TEST_FALSE(runner, Hash_Equals(hash, (Obj*)other),
- "Non-matching value spoils Equals");
-
- DECREF(hash);
- DECREF(other);
-}
-
-static void
-test_Store_and_Fetch(TestBatchRunner *runner) {
- Hash *hash = Hash_new(100);
- Hash *dupe = Hash_new(100);
- const uint32_t starting_cap = Hash_Get_Capacity(hash);
- VArray *expected = VA_new(100);
- VArray *got = VA_new(100);
- ZombieCharBuf *twenty = ZCB_WRAP_STR("20", 2);
- ZombieCharBuf *forty = ZCB_WRAP_STR("40", 2);
- ZombieCharBuf *foo = ZCB_WRAP_STR("foo", 3);
-
- for (int32_t i = 0; i < 100; i++) {
- CharBuf *cb = CB_newf("%i32", i);
- Hash_Store(hash, (Obj*)cb, (Obj*)cb);
- Hash_Store(dupe, (Obj*)cb, INCREF(cb));
- VA_Push(expected, INCREF(cb));
- }
- TEST_TRUE(runner, Hash_Equals(hash, (Obj*)dupe), "Equals");
-
- TEST_INT_EQ(runner, Hash_Get_Capacity(hash), starting_cap,
- "Initial capacity sufficient (no rebuilds)");
-
- for (int32_t i = 0; i < 100; i++) {
- Obj *key = VA_Fetch(expected, i);
- Obj *elem = Hash_Fetch(hash, key);
- VA_Push(got, (Obj*)INCREF(elem));
- }
-
- TEST_TRUE(runner, VA_Equals(got, (Obj*)expected),
- "basic Store and Fetch");
- TEST_INT_EQ(runner, Hash_Get_Size(hash), 100,
- "size incremented properly by Hash_Store");
-
- TEST_TRUE(runner, Hash_Fetch(hash, (Obj*)foo) == NULL,
- "Fetch against non-existent key returns NULL");
-
- Hash_Store(hash, (Obj*)forty, INCREF(foo));
- TEST_TRUE(runner, ZCB_Equals(foo, Hash_Fetch(hash, (Obj*)forty)),
- "Hash_Store replaces existing value");
- TEST_FALSE(runner, Hash_Equals(hash, (Obj*)dupe),
- "replacement value spoils equals");
- TEST_INT_EQ(runner, Hash_Get_Size(hash), 100,
- "size unaffected after value replaced");
-
- TEST_TRUE(runner, Hash_Delete(hash, (Obj*)forty) == (Obj*)foo,
- "Delete returns value");
- DECREF(foo);
- TEST_INT_EQ(runner, Hash_Get_Size(hash), 99,
- "size decremented by successful Delete");
- TEST_TRUE(runner, Hash_Delete(hash, (Obj*)forty) == NULL,
- "Delete returns NULL when key not found");
- TEST_INT_EQ(runner, Hash_Get_Size(hash), 99,
- "size not decremented by unsuccessful Delete");
- DECREF(Hash_Delete(dupe, (Obj*)forty));
- TEST_TRUE(runner, VA_Equals(got, (Obj*)expected), "Equals after Delete");
-
- Hash_Clear(hash);
- TEST_TRUE(runner, Hash_Fetch(hash, (Obj*)twenty) == NULL, "Clear");
- TEST_TRUE(runner, Hash_Get_Size(hash) == 0, "size is 0 after Clear");
-
- DECREF(hash);
- DECREF(dupe);
- DECREF(got);
- DECREF(expected);
-}
-
-static void
-test_Keys_Values_Iter(TestBatchRunner *runner) {
- Hash *hash = Hash_new(0); // trigger multiple rebuilds.
- VArray *expected = VA_new(100);
- VArray *keys;
- VArray *values;
-
- for (uint32_t i = 0; i < 500; i++) {
- CharBuf *cb = CB_newf("%u32", i);
- Hash_Store(hash, (Obj*)cb, (Obj*)cb);
- VA_Push(expected, INCREF(cb));
- }
-
- VA_Sort(expected, NULL, NULL);
-
- keys = Hash_Keys(hash);
- values = Hash_Values(hash);
- VA_Sort(keys, NULL, NULL);
- VA_Sort(values, NULL, NULL);
- TEST_TRUE(runner, VA_Equals(keys, (Obj*)expected), "Keys");
- TEST_TRUE(runner, VA_Equals(values, (Obj*)expected), "Values");
- VA_Clear(keys);
- VA_Clear(values);
-
- {
- Obj *key;
- Obj *value;
- Hash_Iterate(hash);
- while (Hash_Next(hash, &key, &value)) {
- VA_Push(keys, INCREF(key));
- VA_Push(values, INCREF(value));
- }
- }
-
- VA_Sort(keys, NULL, NULL);
- VA_Sort(values, NULL, NULL);
- TEST_TRUE(runner, VA_Equals(keys, (Obj*)expected), "Keys from Iter");
- TEST_TRUE(runner, VA_Equals(values, (Obj*)expected), "Values from Iter");
-
- {
- ZombieCharBuf *forty = ZCB_WRAP_STR("40", 2);
- ZombieCharBuf *nope = ZCB_WRAP_STR("nope", 4);
- Obj *key = Hash_Find_Key(hash, (Obj*)forty, ZCB_Hash_Sum(forty));
- TEST_TRUE(runner, Obj_Equals(key, (Obj*)forty), "Find_Key");
- key = Hash_Find_Key(hash, (Obj*)nope, ZCB_Hash_Sum(nope)),
- TEST_TRUE(runner, key == NULL,
- "Find_Key returns NULL for non-existent key");
- }
-
- DECREF(hash);
- DECREF(expected);
- DECREF(keys);
- DECREF(values);
-}
-
-static void
-test_Dump_and_Load(TestBatchRunner *runner) {
- Hash *hash = Hash_new(0);
- Obj *dump;
- Hash *loaded;
-
- Hash_Store_Str(hash, "foo", 3,
- (Obj*)CB_new_from_trusted_utf8("foo", 3));
- dump = (Obj*)Hash_Dump(hash);
- loaded = (Hash*)Obj_Load(dump, dump);
- TEST_TRUE(runner, Hash_Equals(hash, (Obj*)loaded),
- "Dump => Load round trip");
- DECREF(dump);
- DECREF(loaded);
-
- /* TODO: Fix Hash_Load().
-
- Hash_Store_Str(hash, "_class", 6,
- (Obj*)CB_new_from_trusted_utf8("not_a_class", 11));
- dump = (Obj*)Hash_Dump(hash);
- loaded = (Hash*)Obj_Load(dump, dump);
-
- TEST_TRUE(runner, Hash_Equals(hash, (Obj*)loaded),
- "Load still works with _class if it's not a real class");
- DECREF(dump);
- DECREF(loaded);
-
- */
-
- DECREF(hash);
-}
-
-static void
-test_stress(TestBatchRunner *runner) {
- Hash *hash = Hash_new(0); // trigger multiple rebuilds.
- VArray *expected = VA_new(1000);
- VArray *keys;
- VArray *values;
-
- for (uint32_t i = 0; i < 1000; i++) {
- CharBuf *cb = TestUtils_random_string(rand() % 1200);
- while (Hash_Fetch(hash, (Obj*)cb)) {
- DECREF(cb);
- cb = TestUtils_random_string(rand() % 1200);
- }
- Hash_Store(hash, (Obj*)cb, (Obj*)cb);
- VA_Push(expected, INCREF(cb));
- }
-
- VA_Sort(expected, NULL, NULL);
-
- // Overwrite for good measure.
- for (uint32_t i = 0; i < 1000; i++) {
- CharBuf *cb = (CharBuf*)VA_Fetch(expected, i);
- Hash_Store(hash, (Obj*)cb, INCREF(cb));
- }
-
- keys = Hash_Keys(hash);
- values = Hash_Values(hash);
- VA_Sort(keys, NULL, NULL);
- VA_Sort(values, NULL, NULL);
- TEST_TRUE(runner, VA_Equals(keys, (Obj*)expected), "stress Keys");
- TEST_TRUE(runner, VA_Equals(values, (Obj*)expected), "stress Values");
-
- DECREF(keys);
- DECREF(values);
- DECREF(expected);
- DECREF(hash);
-}
-
-void
-TestHash_run(TestHash *self, TestBatchRunner *runner) {
- TestBatchRunner_Plan(runner, (TestBatch*)self, 28);
- srand((unsigned int)time((time_t*)NULL));
- test_Equals(runner);
- test_Store_and_Fetch(runner);
- test_Keys_Values_Iter(runner);
- test_Dump_and_Load(runner);
- test_stress(runner);
-}
-
-
http://git-wip-us.apache.org/repos/asf/lucy/blob/d31a7233/core/Clownfish/Test/TestHash.cfh
----------------------------------------------------------------------
diff --git a/core/Clownfish/Test/TestHash.cfh b/core/Clownfish/Test/TestHash.cfh
deleted file mode 100644
index a730105..0000000
--- a/core/Clownfish/Test/TestHash.cfh
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-
-parcel TestClownfish;
-
-class Clownfish::Test::TestHash
- inherits Clownfish::TestHarness::TestBatch {
-
- inert incremented TestHash*
- new();
-
- void
- Run(TestHash *self, TestBatchRunner *runner);
-}
-
-
http://git-wip-us.apache.org/repos/asf/lucy/blob/d31a7233/core/Clownfish/Test/TestLockFreeRegistry.c
----------------------------------------------------------------------
diff --git a/core/Clownfish/Test/TestLockFreeRegistry.c b/core/Clownfish/Test/TestLockFreeRegistry.c
deleted file mode 100644
index d895595..0000000
--- a/core/Clownfish/Test/TestLockFreeRegistry.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-
-#include <string.h>
-
-#define CHY_USE_SHORT_NAMES
-#define CFISH_USE_SHORT_NAMES
-#define TESTCFISH_USE_SHORT_NAMES
-
-#include "Clownfish/Test/TestLockFreeRegistry.h"
-
-#include "Clownfish/LockFreeRegistry.h"
-#include "Clownfish/Test.h"
-#include "Clownfish/TestHarness/TestBatchRunner.h"
-#include "Clownfish/VTable.h"
-
-TestLockFreeRegistry*
-TestLFReg_new() {
- return (TestLockFreeRegistry*)VTable_Make_Obj(TESTLOCKFREEREGISTRY);
-}
-
-StupidHashCharBuf*
-StupidHashCharBuf_new(const char *text) {
- return (StupidHashCharBuf*)CB_new_from_utf8(text, strlen(text));
-}
-
-int32_t
-StupidHashCharBuf_hash_sum(StupidHashCharBuf *self) {
- UNUSED_VAR(self);
- return 1;
-}
-
-static void
-test_all(TestBatchRunner *runner) {
- LockFreeRegistry *registry = LFReg_new(10);
- StupidHashCharBuf *foo = StupidHashCharBuf_new("foo");
- StupidHashCharBuf *bar = StupidHashCharBuf_new("bar");
- StupidHashCharBuf *baz = StupidHashCharBuf_new("baz");
- StupidHashCharBuf *foo_dupe = StupidHashCharBuf_new("foo");
-
- TEST_TRUE(runner, LFReg_Register(registry, (Obj*)foo, (Obj*)foo),
- "Register() returns true on success");
- TEST_FALSE(runner,
- LFReg_Register(registry, (Obj*)foo_dupe, (Obj*)foo_dupe),
- "Can't Register() keys that test equal");
-
- TEST_TRUE(runner, LFReg_Register(registry, (Obj*)bar, (Obj*)bar),
- "Register() key with the same Hash_Sum but that isn't Equal");
-
- TEST_TRUE(runner, LFReg_Fetch(registry, (Obj*)foo_dupe) == (Obj*)foo,
- "Fetch()");
- TEST_TRUE(runner, LFReg_Fetch(registry, (Obj*)bar) == (Obj*)bar,
- "Fetch() again");
- TEST_TRUE(runner, LFReg_Fetch(registry, (Obj*)baz) == NULL,
- "Fetch() non-existent key returns NULL");
-
- DECREF(foo_dupe);
- DECREF(baz);
- DECREF(bar);
- DECREF(foo);
- DECREF(registry);
-}
-
-void
-TestLFReg_run(TestLockFreeRegistry *self, TestBatchRunner *runner) {
- TestBatchRunner_Plan(runner, (TestBatch*)self, 6);
- test_all(runner);
-}
-
-
http://git-wip-us.apache.org/repos/asf/lucy/blob/d31a7233/core/Clownfish/Test/TestLockFreeRegistry.cfh
----------------------------------------------------------------------
diff --git a/core/Clownfish/Test/TestLockFreeRegistry.cfh b/core/Clownfish/Test/TestLockFreeRegistry.cfh
deleted file mode 100644
index 039c573..0000000
--- a/core/Clownfish/Test/TestLockFreeRegistry.cfh
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-
-parcel TestClownfish;
-
-class Clownfish::Test::TestLockFreeRegistry cnick TestLFReg
- inherits Clownfish::TestHarness::TestBatch {
-
- inert incremented TestLockFreeRegistry*
- new();
-
- void
- Run(TestLockFreeRegistry *self, TestBatchRunner *runner);
-}
-
-/** Private test-only class for stressing LockFreeRegistry.
- */
-class Clownfish::Test::StupidHashCharBuf inherits Clownfish::CharBuf {
- inert incremented StupidHashCharBuf*
- new(const char *text);
-
- /** Always returns 1, guaranteeing collisions. */
- public int32_t
- Hash_Sum(StupidHashCharBuf *self);
-}
-
-
http://git-wip-us.apache.org/repos/asf/lucy/blob/d31a7233/core/Clownfish/Test/TestNum.c
----------------------------------------------------------------------
diff --git a/core/Clownfish/Test/TestNum.c b/core/Clownfish/Test/TestNum.c
deleted file mode 100644
index 9def22d..0000000
--- a/core/Clownfish/Test/TestNum.c
+++ /dev/null
@@ -1,285 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-
-#define CFISH_USE_SHORT_NAMES
-#define TESTCFISH_USE_SHORT_NAMES
-
-#include "Clownfish/Test/TestNum.h"
-
-#include "Clownfish/CharBuf.h"
-#include "Clownfish/Num.h"
-#include "Clownfish/Test.h"
-#include "Clownfish/TestHarness/TestBatchRunner.h"
-#include "Clownfish/TestHarness/TestUtils.h"
-#include "Clownfish/VTable.h"
-
-TestNum*
-TestNum_new() {
- return (TestNum*)VTable_Make_Obj(TESTNUM);
-}
-
-static void
-test_To_String(TestBatchRunner *runner) {
- Float32 *f32 = Float32_new(1.33f);
- Float64 *f64 = Float64_new(1.33);
- Integer32 *i32 = Int32_new(INT32_MAX);
- Integer64 *i64 = Int64_new(INT64_MAX);
- CharBuf *f32_string = Float32_To_String(f32);
- CharBuf *f64_string = Float64_To_String(f64);
- CharBuf *i32_string = Int32_To_String(i32);
- CharBuf *i64_string = Int64_To_String(i64);
- CharBuf *true_string = Bool_To_String(CFISH_TRUE);
- CharBuf *false_string = Bool_To_String(CFISH_FALSE);
-
- TEST_TRUE(runner, CB_Starts_With_Str(f32_string, "1.3", 3),
- "Float32_To_String");
- TEST_TRUE(runner, CB_Starts_With_Str(f64_string, "1.3", 3),
- "Float64_To_String");
- TEST_TRUE(runner, CB_Equals_Str(i32_string, "2147483647", 10),
- "Int32_To_String");
- TEST_TRUE(runner, CB_Equals_Str(i64_string, "9223372036854775807", 19),
- "Int64_To_String");
- TEST_TRUE(runner, CB_Equals_Str(true_string, "true", 4),
- "Bool_To_String [true]");
- TEST_TRUE(runner, CB_Equals_Str(false_string, "false", 5),
- "Bool_To_String [false]");
-
- DECREF(false_string);
- DECREF(true_string);
- DECREF(i64_string);
- DECREF(i32_string);
- DECREF(f64_string);
- DECREF(f32_string);
- DECREF(i64);
- DECREF(i32);
- DECREF(f64);
- DECREF(f32);
-}
-
-static void
-test_accessors(TestBatchRunner *runner) {
- Float32 *f32 = Float32_new(1.0);
- Float64 *f64 = Float64_new(1.0);
- Integer32 *i32 = Int32_new(1);
- Integer64 *i64 = Int64_new(1);
- float wanted32 = 1.33f;
- double wanted64 = 1.33;
- float got32;
- double got64;
-
- Float32_Set_Value(f32, 1.33f);
- TEST_FLOAT_EQ(runner, Float32_Get_Value(f32), 1.33f,
- "F32 Set_Value Get_Value");
-
- Float64_Set_Value(f64, 1.33);
- got64 = Float64_Get_Value(f64);
- TEST_TRUE(runner, *(int64_t*)&got64 == *(int64_t*)&wanted64,
- "F64 Set_Value Get_Value");
-
- TEST_TRUE(runner, Float32_To_I64(f32) == 1, "Float32_To_I64");
- TEST_TRUE(runner, Float64_To_I64(f64) == 1, "Float64_To_I64");
-
- got32 = (float)Float32_To_F64(f32);
- TEST_TRUE(runner, *(int32_t*)&got32 == *(int32_t*)&wanted32,
- "Float32_To_F64");
-
- got64 = Float64_To_F64(f64);
- TEST_TRUE(runner, *(int64_t*)&got64 == *(int64_t*)&wanted64,
- "Float64_To_F64");
-
- Int32_Set_Value(i32, INT32_MIN);
- TEST_INT_EQ(runner, Int32_Get_Value(i32), INT32_MIN,
- "I32 Set_Value Get_Value");
-
- Int64_Set_Value(i64, INT64_MIN);
- TEST_TRUE(runner, Int64_Get_Value(i64) == INT64_MIN,
- "I64 Set_Value Get_Value");
-
- Int32_Set_Value(i32, -1);
- Int64_Set_Value(i64, -1);
- TEST_TRUE(runner, Int32_To_F64(i32) == -1, "Int32_To_F64");
- TEST_TRUE(runner, Int64_To_F64(i64) == -1, "Int64_To_F64");
-
- TEST_INT_EQ(runner, Bool_Get_Value(CFISH_TRUE), true,
- "Bool_Get_Value [true]");
- TEST_INT_EQ(runner, Bool_Get_Value(CFISH_FALSE), false,
- "Bool_Get_Value [false]");
- TEST_TRUE(runner, Bool_To_I64(CFISH_TRUE) == true,
- "Bool_To_I64 [true]");
- TEST_TRUE(runner, Bool_To_I64(CFISH_FALSE) == false,
- "Bool_To_I64 [false]");
- TEST_TRUE(runner, Bool_To_F64(CFISH_TRUE) == 1.0,
- "Bool_To_F64 [true]");
- TEST_TRUE(runner, Bool_To_F64(CFISH_FALSE) == 0.0,
- "Bool_To_F64 [false]");
-
- DECREF(i64);
- DECREF(i32);
- DECREF(f64);
- DECREF(f32);
-}
-
-static void
-test_Equals_and_Compare_To(TestBatchRunner *runner) {
- Float32 *f32 = Float32_new(1.0);
- Float64 *f64 = Float64_new(1.0);
- Integer32 *i32 = Int32_new(INT32_MAX);
- Integer64 *i64 = Int64_new(INT64_MAX);
-
- TEST_TRUE(runner, Float32_Compare_To(f32, (Obj*)f64) == 0,
- "F32_Compare_To equal");
- TEST_TRUE(runner, Float32_Equals(f32, (Obj*)f64),
- "F32_Equals equal");
-
- Float64_Set_Value(f64, 2.0);
- TEST_TRUE(runner, Float32_Compare_To(f32, (Obj*)f64) < 0,
- "F32_Compare_To less than");
- TEST_FALSE(runner, Float32_Equals(f32, (Obj*)f64),
- "F32_Equals less than");
-
- Float64_Set_Value(f64, 0.0);
- TEST_TRUE(runner, Float32_Compare_To(f32, (Obj*)f64) > 0,
- "F32_Compare_To greater than");
- TEST_FALSE(runner, Float32_Equals(f32, (Obj*)f64),
- "F32_Equals greater than");
-
- Float64_Set_Value(f64, 1.0);
- Float32_Set_Value(f32, 1.0);
- TEST_TRUE(runner, Float64_Compare_To(f64, (Obj*)f32) == 0,
- "F64_Compare_To equal");
- TEST_TRUE(runner, Float64_Equals(f64, (Obj*)f32),
- "F64_Equals equal");
-
- Float32_Set_Value(f32, 2.0);
- TEST_TRUE(runner, Float64_Compare_To(f64, (Obj*)f32) < 0,
- "F64_Compare_To less than");
- TEST_FALSE(runner, Float64_Equals(f64, (Obj*)f32),
- "F64_Equals less than");
-
- Float32_Set_Value(f32, 0.0);
- TEST_TRUE(runner, Float64_Compare_To(f64, (Obj*)f32) > 0,
- "F64_Compare_To greater than");
- TEST_FALSE(runner, Float64_Equals(f64, (Obj*)f32),
- "F64_Equals greater than");
-
- Float64_Set_Value(f64, INT64_MAX * 2.0);
- TEST_TRUE(runner, Float64_Compare_To(f64, (Obj*)i64) > 0,
- "Float64 comparison to Integer64");
- TEST_TRUE(runner, Int64_Compare_To(i64, (Obj*)f64) < 0,
- "Integer64 comparison to Float64");
-
- Float32_Set_Value(f32, INT32_MAX * 2.0f);
- TEST_TRUE(runner, Float32_Compare_To(f32, (Obj*)i32) > 0,
- "Float32 comparison to Integer32");
- TEST_TRUE(runner, Int32_Compare_To(i32, (Obj*)f32) < 0,
- "Integer32 comparison to Float32");
-
- Int64_Set_Value(i64, INT64_C(0x6666666666666666));
- Integer64 *i64_copy = Int64_new(INT64_C(0x6666666666666666));
- TEST_TRUE(runner, Int64_Compare_To(i64, (Obj*)i64_copy) == 0,
- "Integer64 comparison to same number");
-
- TEST_TRUE(runner, Bool_Equals(CFISH_TRUE, (Obj*)CFISH_TRUE),
- "CFISH_TRUE Equals itself");
- TEST_TRUE(runner, Bool_Equals(CFISH_FALSE, (Obj*)CFISH_FALSE),
- "CFISH_FALSE Equals itself");
- TEST_FALSE(runner, Bool_Equals(CFISH_FALSE, (Obj*)CFISH_TRUE),
- "CFISH_FALSE not Equals CFISH_TRUE ");
- TEST_FALSE(runner, Bool_Equals(CFISH_TRUE, (Obj*)CFISH_FALSE),
- "CFISH_TRUE not Equals CFISH_FALSE ");
- TEST_FALSE(runner, Bool_Equals(CFISH_TRUE, (Obj*)CHARBUF),
- "CFISH_TRUE not Equals random other object ");
-
- DECREF(i64_copy);
- DECREF(i64);
- DECREF(i32);
- DECREF(f64);
- DECREF(f32);
-}
-
-static void
-test_Clone(TestBatchRunner *runner) {
- Float32 *f32 = Float32_new(1.33f);
- Float64 *f64 = Float64_new(1.33);
- Integer32 *i32 = Int32_new(INT32_MAX);
- Integer64 *i64 = Int64_new(INT64_MAX);
- Float32 *f32_dupe = Float32_Clone(f32);
- Float64 *f64_dupe = Float64_Clone(f64);
- Integer32 *i32_dupe = Int32_Clone(i32);
- Integer64 *i64_dupe = Int64_Clone(i64);
- TEST_TRUE(runner, Float32_Equals(f32, (Obj*)f32_dupe),
- "Float32 Clone");
- TEST_TRUE(runner, Float64_Equals(f64, (Obj*)f64_dupe),
- "Float64 Clone");
- TEST_TRUE(runner, Int32_Equals(i32, (Obj*)i32_dupe),
- "Integer32 Clone");
- TEST_TRUE(runner, Int64_Equals(i64, (Obj*)i64_dupe),
- "Integer64 Clone");
- TEST_TRUE(runner, Bool_Equals(CFISH_TRUE, (Obj*)Bool_Clone(CFISH_TRUE)),
- "BoolNum Clone");
- DECREF(i64_dupe);
- DECREF(i32_dupe);
- DECREF(f64_dupe);
- DECREF(f32_dupe);
- DECREF(i64);
- DECREF(i32);
- DECREF(f64);
- DECREF(f32);
-}
-
-static void
-test_Mimic(TestBatchRunner *runner) {
- Float32 *f32 = Float32_new(1.33f);
- Float64 *f64 = Float64_new(1.33);
- Integer32 *i32 = Int32_new(INT32_MAX);
- Integer64 *i64 = Int64_new(INT64_MAX);
- Float32 *f32_dupe = Float32_new(0.0f);
- Float64 *f64_dupe = Float64_new(0.0);
- Integer32 *i32_dupe = Int32_new(0);
- Integer64 *i64_dupe = Int64_new(0);
- Float32_Mimic(f32_dupe, (Obj*)f32);
- Float64_Mimic(f64_dupe, (Obj*)f64);
- Int32_Mimic(i32_dupe, (Obj*)i32);
- Int64_Mimic(i64_dupe, (Obj*)i64);
- TEST_TRUE(runner, Float32_Equals(f32, (Obj*)f32_dupe),
- "Float32 Mimic");
- TEST_TRUE(runner, Float64_Equals(f64, (Obj*)f64_dupe),
- "Float64 Mimic");
- TEST_TRUE(runner, Int32_Equals(i32, (Obj*)i32_dupe),
- "Integer32 Mimic");
- TEST_TRUE(runner, Int64_Equals(i64, (Obj*)i64_dupe),
- "Integer64 Mimic");
- DECREF(i64_dupe);
- DECREF(i32_dupe);
- DECREF(f64_dupe);
- DECREF(f32_dupe);
- DECREF(i64);
- DECREF(i32);
- DECREF(f64);
- DECREF(f32);
-}
-
-void
-TestNum_run(TestNum *self, TestBatchRunner *runner) {
- TestBatchRunner_Plan(runner, (TestBatch*)self, 53);
- test_To_String(runner);
- test_accessors(runner);
- test_Equals_and_Compare_To(runner);
- test_Clone(runner);
- test_Mimic(runner);
-}
-
-
http://git-wip-us.apache.org/repos/asf/lucy/blob/d31a7233/core/Clownfish/Test/TestNum.cfh
----------------------------------------------------------------------
diff --git a/core/Clownfish/Test/TestNum.cfh b/core/Clownfish/Test/TestNum.cfh
deleted file mode 100644
index 6d1f663..0000000
--- a/core/Clownfish/Test/TestNum.cfh
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-
-parcel TestClownfish;
-
-class Clownfish::Test::TestNum
- inherits Clownfish::TestHarness::TestBatch {
-
- inert incremented TestNum*
- new();
-
- void
- Run(TestNum *self, TestBatchRunner *runner);
-}
-
-
http://git-wip-us.apache.org/repos/asf/lucy/blob/d31a7233/core/Clownfish/Test/TestObj.c
----------------------------------------------------------------------
diff --git a/core/Clownfish/Test/TestObj.c b/core/Clownfish/Test/TestObj.c
deleted file mode 100644
index f1d6d90..0000000
--- a/core/Clownfish/Test/TestObj.c
+++ /dev/null
@@ -1,210 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-
-#include <stdio.h>
-
-#define CHY_USE_SHORT_NAMES
-#define CFISH_USE_SHORT_NAMES
-#define TESTCFISH_USE_SHORT_NAMES
-
-#include "Clownfish/Test/TestObj.h"
-
-#include "Clownfish/CharBuf.h"
-#include "Clownfish/Err.h"
-#include "Clownfish/Test.h"
-#include "Clownfish/TestHarness/TestBatchRunner.h"
-#include "Clownfish/VTable.h"
-
-TestObj*
-TestObj_new() {
- return (TestObj*)VTable_Make_Obj(TESTOBJ);
-}
-
-static Obj*
-S_new_testobj() {
- ZombieCharBuf *klass = ZCB_WRAP_STR("TestObj", 7);
- Obj *obj;
- VTable *vtable = VTable_fetch_vtable((CharBuf*)klass);
- if (!vtable) {
- vtable = VTable_singleton((CharBuf*)klass, OBJ);
- }
- obj = VTable_Make_Obj(vtable);
- return Obj_init(obj);
-}
-
-static void
-test_refcounts(TestBatchRunner *runner) {
- Obj *obj = S_new_testobj();
-
- TEST_INT_EQ(runner, Obj_Get_RefCount(obj), 1,
- "Correct starting refcount");
-
- Obj_Inc_RefCount(obj);
- TEST_INT_EQ(runner, Obj_Get_RefCount(obj), 2, "Inc_RefCount");
-
- Obj_Dec_RefCount(obj);
- TEST_INT_EQ(runner, Obj_Get_RefCount(obj), 1, "Dec_RefCount");
-
- DECREF(obj);
-}
-
-static void
-test_To_String(TestBatchRunner *runner) {
- Obj *testobj = S_new_testobj();
- CharBuf *string = Obj_To_String(testobj);
- ZombieCharBuf *temp = ZCB_WRAP(string);
- while (ZCB_Get_Size(temp)) {
- if (ZCB_Starts_With_Str(temp, "TestObj", 7)) { break; }
- ZCB_Nip_One(temp);
- }
- TEST_TRUE(runner, ZCB_Starts_With_Str(temp, "TestObj", 7), "To_String");
- DECREF(string);
- DECREF(testobj);
-}
-
-static void
-test_Dump(TestBatchRunner *runner) {
- Obj *testobj = S_new_testobj();
- CharBuf *string = Obj_To_String(testobj);
- Obj *dump = Obj_Dump(testobj);
- TEST_TRUE(runner, Obj_Equals(dump, (Obj*)string),
- "Default Dump returns To_String");
- DECREF(dump);
- DECREF(string);
- DECREF(testobj);
-}
-
-static void
-test_Equals(TestBatchRunner *runner) {
- Obj *testobj = S_new_testobj();
- Obj *other = S_new_testobj();
-
- TEST_TRUE(runner, Obj_Equals(testobj, testobj),
- "Equals is true for the same object");
- TEST_FALSE(runner, Obj_Equals(testobj, other),
- "Distinct objects are not equal");
-
- DECREF(testobj);
- DECREF(other);
-}
-
-static void
-test_Hash_Sum(TestBatchRunner *runner) {
- Obj *testobj = S_new_testobj();
- int64_t address64 = PTR_TO_I64(testobj);
- int32_t address32 = (int32_t)address64;
- TEST_TRUE(runner, (Obj_Hash_Sum(testobj) == address32),
- "Hash_Sum uses memory address");
- DECREF(testobj);
-}
-
-static void
-test_Is_A(TestBatchRunner *runner) {
- CharBuf *charbuf = CB_new(0);
- VTable *bb_vtable = CB_Get_VTable(charbuf);
- CharBuf *klass = CB_Get_Class_Name(charbuf);
-
- TEST_TRUE(runner, CB_Is_A(charbuf, CHARBUF), "CharBuf Is_A CharBuf.");
- TEST_TRUE(runner, CB_Is_A(charbuf, OBJ), "CharBuf Is_A Obj.");
- TEST_TRUE(runner, bb_vtable == CHARBUF, "Get_VTable");
- TEST_TRUE(runner, CB_Equals(VTable_Get_Name(CHARBUF), (Obj*)klass),
- "Get_Class_Name");
-
- DECREF(charbuf);
-}
-
-static void
-S_attempt_init(void *context) {
- Obj_init((Obj*)context);
-}
-
-static void
-S_attempt_Clone(void *context) {
- Obj_Clone((Obj*)context);
-}
-
-static void
-S_attempt_Make(void *context) {
- Obj_Make((Obj*)context);
-}
-
-static void
-S_attempt_Compare_To(void *context) {
- Obj_Compare_To((Obj*)context, (Obj*)context);
-}
-
-static void
-S_attempt_To_I64(void *context) {
- Obj_To_I64((Obj*)context);
-}
-
-static void
-S_attempt_To_F64(void *context) {
- Obj_To_F64((Obj*)context);
-}
-
-static void
-S_attempt_Load(void *context) {
- Obj_Load((Obj*)context, (Obj*)context);
-}
-
-static void
-S_attempt_Mimic(void *context) {
- Obj_Mimic((Obj*)context, (Obj*)context);
-}
-
-static void
-S_verify_abstract_error(TestBatchRunner *runner, Err_Attempt_t routine,
- void *context, const char *name) {
- char message[100];
- sprintf(message, "%s() is abstract", name);
- Err *error = Err_trap(routine, context);
- TEST_TRUE(runner, error != NULL
- && Err_Is_A(error, ERR)
- && CB_Find_Str(Err_Get_Mess(error), "bstract", 7) != -1,
- message);
- DECREF(error);
-}
-
-static void
-test_abstract_routines(TestBatchRunner *runner) {
- Obj *blank = VTable_Make_Obj(OBJ);
- S_verify_abstract_error(runner, S_attempt_init, blank, "init");
-
- Obj *obj = S_new_testobj();
- S_verify_abstract_error(runner, S_attempt_Clone, obj, "Clone");
- S_verify_abstract_error(runner, S_attempt_Make, obj, "Make");
- S_verify_abstract_error(runner, S_attempt_Compare_To, obj, "Compare_To");
- S_verify_abstract_error(runner, S_attempt_To_I64, obj, "To_I64");
- S_verify_abstract_error(runner, S_attempt_To_F64, obj, "To_F64");
- S_verify_abstract_error(runner, S_attempt_Load, obj, "Load");
- S_verify_abstract_error(runner, S_attempt_Mimic, obj, "Mimic");
- DECREF(obj);
-}
-
-void
-TestObj_run(TestObj *self, TestBatchRunner *runner) {
- TestBatchRunner_Plan(runner, (TestBatch*)self, 20);
- test_refcounts(runner);
- test_To_String(runner);
- test_Dump(runner);
- test_Equals(runner);
- test_Hash_Sum(runner);
- test_Is_A(runner);
- test_abstract_routines(runner);
-}
-
-
http://git-wip-us.apache.org/repos/asf/lucy/blob/d31a7233/core/Clownfish/Test/TestObj.cfh
----------------------------------------------------------------------
diff --git a/core/Clownfish/Test/TestObj.cfh b/core/Clownfish/Test/TestObj.cfh
deleted file mode 100644
index eb4a0b6..0000000
--- a/core/Clownfish/Test/TestObj.cfh
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-
-parcel TestClownfish;
-
-class Clownfish::Test::TestObj
- inherits Clownfish::TestHarness::TestBatch {
-
- inert incremented TestObj*
- new();
-
- void
- Run(TestObj *self, TestBatchRunner *runner);
-}
-
-
http://git-wip-us.apache.org/repos/asf/lucy/blob/d31a7233/core/Clownfish/Test/TestVArray.c
----------------------------------------------------------------------
diff --git a/core/Clownfish/Test/TestVArray.c b/core/Clownfish/Test/TestVArray.c
deleted file mode 100644
index b012d7c..0000000
--- a/core/Clownfish/Test/TestVArray.c
+++ /dev/null
@@ -1,333 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-
-#include <string.h>
-
-#define CFISH_USE_SHORT_NAMES
-#define TESTCFISH_USE_SHORT_NAMES
-
-#include "Clownfish/Test/TestVArray.h"
-
-#include "Clownfish/CharBuf.h"
-#include "Clownfish/Err.h"
-#include "Clownfish/Num.h"
-#include "Clownfish/Test.h"
-#include "Clownfish/TestHarness/TestBatchRunner.h"
-#include "Clownfish/TestHarness/TestUtils.h"
-#include "Clownfish/VArray.h"
-#include "Clownfish/VTable.h"
-
-TestVArray*
-TestVArray_new() {
- return (TestVArray*)VTable_Make_Obj(TESTVARRAY);
-}
-
-static CharBuf*
-S_new_cb(const char *text) {
- return CB_new_from_utf8(text, strlen(text));
-}
-
-static void
-test_Equals(TestBatchRunner *runner) {
- VArray *array = VA_new(0);
- VArray *other = VA_new(0);
- ZombieCharBuf *stuff = ZCB_WRAP_STR("stuff", 5);
-
- TEST_TRUE(runner, VA_Equals(array, (Obj*)other),
- "Empty arrays are equal");
-
- VA_Push(array, (Obj*)CFISH_TRUE);
- TEST_FALSE(runner, VA_Equals(array, (Obj*)other),
- "Add one elem and Equals returns false");
-
- VA_Push(other, (Obj*)CFISH_TRUE);
- TEST_TRUE(runner, VA_Equals(array, (Obj*)other),
- "Add a matching elem and Equals returns true");
-
- VA_Store(array, 2, (Obj*)CFISH_TRUE);
- TEST_FALSE(runner, VA_Equals(array, (Obj*)other),
- "Add elem after a NULL and Equals returns false");
-
- VA_Store(other, 2, (Obj*)CFISH_TRUE);
- TEST_TRUE(runner, VA_Equals(array, (Obj*)other),
- "Empty elems don't spoil Equals");
-
- VA_Store(other, 2, INCREF(stuff));
- TEST_FALSE(runner, VA_Equals(array, (Obj*)other),
- "Non-matching value spoils Equals");
-
- VA_Excise(array, 1, 2); // removes empty elems
- VA_Delete(other, 1); // leaves NULL in place of deleted elem
- VA_Delete(other, 2);
- TEST_FALSE(runner, VA_Equals(array, (Obj*)other),
- "Empty trailing elements spoil Equals");
-
- DECREF(array);
- DECREF(other);
-}
-
-static void
-test_Store_Fetch(TestBatchRunner *runner) {
- VArray *array = VA_new(0);
- CharBuf *elem;
-
- TEST_TRUE(runner, VA_Fetch(array, 2) == NULL, "Fetch beyond end");
-
- VA_Store(array, 2, (Obj*)CB_newf("foo"));
- elem = (CharBuf*)CERTIFY(VA_Fetch(array, 2), CHARBUF);
- TEST_INT_EQ(runner, 3, VA_Get_Size(array), "Store updates size");
- TEST_TRUE(runner, CB_Equals_Str(elem, "foo", 3), "Store");
-
- INCREF(elem);
- TEST_INT_EQ(runner, 2, CB_Get_RefCount(elem),
- "start with refcount of 2");
- VA_Store(array, 2, (Obj*)CB_newf("bar"));
- TEST_INT_EQ(runner, 1, CB_Get_RefCount(elem),
- "Displacing elem via Store updates refcount");
- DECREF(elem);
- elem = (CharBuf*)CERTIFY(VA_Fetch(array, 2), CHARBUF);
- TEST_TRUE(runner, CB_Equals_Str(elem, "bar", 3), "Store displacement");
-
- DECREF(array);
-}
-
-static void
-test_Push_Pop_Shift_Unshift(TestBatchRunner *runner) {
- VArray *array = VA_new(0);
- CharBuf *elem;
-
- TEST_INT_EQ(runner, VA_Get_Size(array), 0, "size starts at 0");
- VA_Push(array, (Obj*)CB_newf("a"));
- VA_Push(array, (Obj*)CB_newf("b"));
- VA_Push(array, (Obj*)CB_newf("c"));
-
- TEST_INT_EQ(runner, VA_Get_Size(array), 3, "size after Push");
- TEST_TRUE(runner, NULL != CERTIFY(VA_Fetch(array, 2), CHARBUF), "Push");
-
- elem = (CharBuf*)CERTIFY(VA_Shift(array), CHARBUF);
- TEST_TRUE(runner, CB_Equals_Str(elem, "a", 1), "Shift");
- TEST_INT_EQ(runner, VA_Get_Size(array), 2, "size after Shift");
- DECREF(elem);
-
- elem = (CharBuf*)CERTIFY(VA_Pop(array), CHARBUF);
- TEST_TRUE(runner, CB_Equals_Str(elem, "c", 1), "Pop");
- TEST_INT_EQ(runner, VA_Get_Size(array), 1, "size after Pop");
- DECREF(elem);
-
- VA_Unshift(array, (Obj*)CB_newf("foo"));
- elem = (CharBuf*)CERTIFY(VA_Fetch(array, 0), CHARBUF);
- TEST_TRUE(runner, CB_Equals_Str(elem, "foo", 3), "Unshift");
- TEST_INT_EQ(runner, VA_Get_Size(array), 2, "size after Shift");
-
- DECREF(array);
-}
-
-static void
-test_Delete(TestBatchRunner *runner) {
- VArray *wanted = VA_new(5);
- VArray *got = VA_new(5);
- uint32_t i;
-
- for (i = 0; i < 5; i++) { VA_Push(got, (Obj*)CB_newf("%u32", i)); }
- VA_Store(wanted, 0, (Obj*)CB_newf("0", i));
- VA_Store(wanted, 1, (Obj*)CB_newf("1", i));
- VA_Store(wanted, 4, (Obj*)CB_newf("4", i));
- DECREF(VA_Delete(got, 2));
- DECREF(VA_Delete(got, 3));
- TEST_TRUE(runner, VA_Equals(wanted, (Obj*)got), "Delete");
-
- DECREF(wanted);
- DECREF(got);
-}
-
-static void
-test_Resize(TestBatchRunner *runner) {
- VArray *array = VA_new(3);
- uint32_t i;
-
- for (i = 0; i < 2; i++) { VA_Push(array, (Obj*)CB_newf("%u32", i)); }
- TEST_INT_EQ(runner, VA_Get_Capacity(array), 3, "Start with capacity 3");
-
- VA_Resize(array, 4);
- TEST_INT_EQ(runner, VA_Get_Size(array), 4, "Resize up");
- TEST_INT_EQ(runner, VA_Get_Capacity(array), 4,
- "Resize changes capacity");
-
- VA_Resize(array, 2);
- TEST_INT_EQ(runner, VA_Get_Size(array), 2, "Resize down");
- TEST_TRUE(runner, VA_Fetch(array, 2) == NULL, "Resize down zaps elem");
-
- DECREF(array);
-}
-
-static void
-test_Excise(TestBatchRunner *runner) {
- VArray *wanted = VA_new(5);
- VArray *got = VA_new(5);
-
- for (uint32_t i = 0; i < 5; i++) {
- VA_Push(wanted, (Obj*)CB_newf("%u32", i));
- VA_Push(got, (Obj*)CB_newf("%u32", i));
- }
-
- VA_Excise(got, 7, 1);
- TEST_TRUE(runner, VA_Equals(wanted, (Obj*)got),
- "Excise outside of range is no-op");
-
- VA_Excise(got, 2, 2);
- DECREF(VA_Delete(wanted, 2));
- DECREF(VA_Delete(wanted, 3));
- VA_Store(wanted, 2, VA_Delete(wanted, 4));
- VA_Resize(wanted, 3);
- TEST_TRUE(runner, VA_Equals(wanted, (Obj*)got),
- "Excise multiple elems");
-
- VA_Excise(got, 2, 2);
- VA_Resize(wanted, 2);
- TEST_TRUE(runner, VA_Equals(wanted, (Obj*)got),
- "Splicing too many elems truncates");
-
- VA_Excise(got, 0, 1);
- VA_Store(wanted, 0, VA_Delete(wanted, 1));
- VA_Resize(wanted, 1);
- TEST_TRUE(runner, VA_Equals(wanted, (Obj*)got),
- "Excise first elem");
-
- DECREF(got);
- DECREF(wanted);
-}
-
-static void
-test_Push_VArray(TestBatchRunner *runner) {
- VArray *wanted = VA_new(0);
- VArray *got = VA_new(0);
- VArray *scratch = VA_new(0);
- uint32_t i;
-
- for (i = 0; i < 4; i++) { VA_Push(wanted, (Obj*)CB_newf("%u32", i)); }
- for (i = 0; i < 2; i++) { VA_Push(got, (Obj*)CB_newf("%u32", i)); }
- for (i = 2; i < 4; i++) { VA_Push(scratch, (Obj*)CB_newf("%u32", i)); }
-
- VA_Push_VArray(got, scratch);
- TEST_TRUE(runner, VA_Equals(wanted, (Obj*)got), "Push_VArray");
-
- DECREF(wanted);
- DECREF(got);
- DECREF(scratch);
-}
-
-static void
-test_Slice(TestBatchRunner *runner) {
- VArray *array = VA_new(0);
- for (uint32_t i = 0; i < 10; i++) { VA_Push(array, (Obj*)CB_newf("%u32", i)); }
- {
- VArray *slice = VA_Slice(array, 0, 10);
- TEST_TRUE(runner, VA_Equals(array, (Obj*)slice), "Slice entire array");
- DECREF(slice);
- }
- {
- VArray *slice = VA_Slice(array, 0, 11);
- TEST_TRUE(runner, VA_Equals(array, (Obj*)slice),
- "Exceed length");
- DECREF(slice);
- }
- {
- VArray *wanted = VA_new(0);
- VA_Push(wanted, (Obj*)CB_newf("9"));
- VArray *slice = VA_Slice(array, 9, 11);
- TEST_TRUE(runner, VA_Equals(slice, (Obj*)wanted),
- "Exceed length, start near end");
- DECREF(slice);
- DECREF(wanted);
- }
- {
- VArray *slice = VA_Slice(array, 0, 0);
- TEST_TRUE(runner, VA_Get_Size(slice) == 0, "empty slice");
- DECREF(slice);
- }
- {
- VArray *slice = VA_Slice(array, 20, 1);
- TEST_TRUE(runner, VA_Get_Size(slice) == 0, "exceed offset");
- DECREF(slice);
- }
- {
- VArray *wanted = VA_new(0);
- VA_Push(wanted, (Obj*)CB_newf("9"));
- VArray *slice = VA_Slice(array, 9, UINT32_MAX - 1);
- TEST_TRUE(runner, VA_Get_Size(slice) == 1, "guard against overflow");
- DECREF(slice);
- DECREF(wanted);
- }
- DECREF(array);
-}
-
-static void
-test_Clone_and_Shallow_Copy(TestBatchRunner *runner) {
- VArray *array = VA_new(0);
- VArray *twin;
- uint32_t i;
-
- for (i = 0; i < 10; i++) {
- VA_Push(array, (Obj*)CB_newf("%u32", i));
- }
- twin = VA_Shallow_Copy(array);
- TEST_TRUE(runner, VA_Equals(array, (Obj*)twin), "Shallow_Copy");
- TEST_TRUE(runner, VA_Fetch(array, 1) == VA_Fetch(twin, 1),
- "Shallow_Copy doesn't clone elements");
- DECREF(twin);
-
- twin = VA_Clone(array);
- TEST_TRUE(runner, VA_Equals(array, (Obj*)twin), "Clone");
- TEST_TRUE(runner, VA_Fetch(array, 1) != VA_Fetch(twin, 1),
- "Clone performs deep clone");
-
- DECREF(array);
- DECREF(twin);
-}
-
-static void
-test_Dump_and_Load(TestBatchRunner *runner) {
- VArray *array = VA_new(0);
- Obj *dump;
- VArray *loaded;
-
- VA_Push(array, (Obj*)S_new_cb("foo"));
- dump = (Obj*)VA_Dump(array);
- loaded = (VArray*)Obj_Load(dump, dump);
- TEST_TRUE(runner, VA_Equals(array, (Obj*)loaded),
- "Dump => Load round trip");
-
- DECREF(array);
- DECREF(dump);
- DECREF(loaded);
-}
-
-void
-TestVArray_run(TestVArray *self, TestBatchRunner *runner) {
- TestBatchRunner_Plan(runner, (TestBatch*)self, 44);
- test_Equals(runner);
- test_Store_Fetch(runner);
- test_Push_Pop_Shift_Unshift(runner);
- test_Delete(runner);
- test_Resize(runner);
- test_Excise(runner);
- test_Push_VArray(runner);
- test_Slice(runner);
- test_Clone_and_Shallow_Copy(runner);
- test_Dump_and_Load(runner);
-}
-
-
http://git-wip-us.apache.org/repos/asf/lucy/blob/d31a7233/core/Clownfish/Test/TestVArray.cfh
----------------------------------------------------------------------
diff --git a/core/Clownfish/Test/TestVArray.cfh b/core/Clownfish/Test/TestVArray.cfh
deleted file mode 100644
index 735fccb..0000000
--- a/core/Clownfish/Test/TestVArray.cfh
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-
-parcel TestClownfish;
-
-class Clownfish::Test::TestVArray
- inherits Clownfish::TestHarness::TestBatch {
-
- inert incremented TestVArray*
- new();
-
- void
- Run(TestVArray *self, TestBatchRunner *runner);
-}
-
-
http://git-wip-us.apache.org/repos/asf/lucy/blob/d31a7233/core/Clownfish/Test/Util/TestAtomic.c
----------------------------------------------------------------------
diff --git a/core/Clownfish/Test/Util/TestAtomic.c b/core/Clownfish/Test/Util/TestAtomic.c
deleted file mode 100644
index d2cb408..0000000
--- a/core/Clownfish/Test/Util/TestAtomic.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-
-#define CFISH_USE_SHORT_NAMES
-#define TESTCFISH_USE_SHORT_NAMES
-
-#include "Clownfish/Test/Util/TestAtomic.h"
-
-#include "Clownfish/Test.h"
-#include "Clownfish/TestHarness/TestBatchRunner.h"
-#include "Clownfish/Util/Atomic.h"
-#include "Clownfish/VTable.h"
-
-TestAtomic*
-TestAtomic_new() {
- return (TestAtomic*)VTable_Make_Obj(TESTATOMIC);
-}
-
-static void
-test_cas_ptr(TestBatchRunner *runner) {
- int foo = 1;
- int bar = 2;
- int *foo_pointer = &foo;
- int *bar_pointer = &bar;
- int *target = NULL;
-
- TEST_TRUE(runner,
- Atomic_cas_ptr((void**)&target, NULL, foo_pointer),
- "cas_ptr returns true on success");
- TEST_TRUE(runner, target == foo_pointer, "cas_ptr sets target");
-
- target = NULL;
- TEST_FALSE(runner,
- Atomic_cas_ptr((void**)&target, bar_pointer, foo_pointer),
- "cas_ptr returns false when it old_value doesn't match");
- TEST_TRUE(runner, target == NULL,
- "cas_ptr doesn't do anything to target when old_value doesn't match");
-
- target = foo_pointer;
- TEST_TRUE(runner,
- Atomic_cas_ptr((void**)&target, foo_pointer, bar_pointer),
- "cas_ptr from one value to another");
- TEST_TRUE(runner, target == bar_pointer, "cas_ptr sets target");
-}
-
-void
-TestAtomic_run(TestAtomic *self, TestBatchRunner *runner) {
- TestBatchRunner_Plan(runner, (TestBatch*)self, 6);
- test_cas_ptr(runner);
-}
-
-
http://git-wip-us.apache.org/repos/asf/lucy/blob/d31a7233/core/Clownfish/Test/Util/TestAtomic.cfh
----------------------------------------------------------------------
diff --git a/core/Clownfish/Test/Util/TestAtomic.cfh b/core/Clownfish/Test/Util/TestAtomic.cfh
deleted file mode 100644
index 2788342..0000000
--- a/core/Clownfish/Test/Util/TestAtomic.cfh
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-
-parcel TestClownfish;
-
-class Clownfish::Test::Util::TestAtomic
- inherits Clownfish::TestHarness::TestBatch {
-
- inert incremented TestAtomic*
- new();
-
- void
- Run(TestAtomic *self, TestBatchRunner *runner);
-}
-
-
http://git-wip-us.apache.org/repos/asf/lucy/blob/d31a7233/core/Clownfish/Test/Util/TestMemory.c
----------------------------------------------------------------------
diff --git a/core/Clownfish/Test/Util/TestMemory.c b/core/Clownfish/Test/Util/TestMemory.c
deleted file mode 100644
index 24c8ad3..0000000
--- a/core/Clownfish/Test/Util/TestMemory.c
+++ /dev/null
@@ -1,118 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-
-#define CHY_USE_SHORT_NAMES
-#define CFISH_USE_SHORT_NAMES
-#define TESTCFISH_USE_SHORT_NAMES
-
-#include "Clownfish/Test/Util/TestMemory.h"
-
-#include "Clownfish/Test.h"
-#include "Clownfish/TestHarness/TestBatchRunner.h"
-#include "Clownfish/Util/Memory.h"
-#include "Clownfish/VTable.h"
-
-TestMemory*
-TestMemory_new() {
- return (TestMemory*)VTable_Make_Obj(TESTMEMORY);
-}
-
-static void
-test_oversize__growth_rate(TestBatchRunner *runner) {
- bool success = true;
- uint64_t size = 0;
- double growth_count = 0;
- double average_growth_rate = 0.0;
-
- while (size < SIZE_MAX) {
- uint64_t next_size = Memory_oversize((size_t)size + 1, sizeof(void*));
- if (next_size < size) {
- success = false;
- FAIL(runner, "Asked for %" PRId64 ", got smaller amount %" PRId64,
- size + 1, next_size);
- break;
- }
- if (size > 0) {
- growth_count += 1;
- double growth_rate = U64_TO_DOUBLE(next_size) /
- U64_TO_DOUBLE(size);
- double sum = growth_rate + (growth_count - 1) * average_growth_rate;
- average_growth_rate = sum / growth_count;
- if (average_growth_rate < 1.1) {
- FAIL(runner, "Average growth rate dropped below 1.1x: %f",
- average_growth_rate);
- success = false;
- break;
- }
- }
- size = next_size;
- }
- TEST_TRUE(runner, growth_count > 0, "Grew %f times", growth_count);
- if (success) {
- TEST_TRUE(runner, average_growth_rate > 1.1,
- "Growth rate of oversize() averages above 1.1: %.3f",
- average_growth_rate);
- }
-
- for (int minimum = 1; minimum < 8; minimum++) {
- uint64_t next_size = Memory_oversize(minimum, sizeof(void*));
- double growth_rate = U64_TO_DOUBLE(next_size) / (double)minimum;
- TEST_TRUE(runner, growth_rate > 1.2,
- "Growth rate is higher for smaller arrays (%d, %.3f)", minimum,
- growth_rate);
- }
-}
-
-static void
-test_oversize__ceiling(TestBatchRunner *runner) {
- for (int width = 0; width < 10; width++) {
- size_t size = Memory_oversize(SIZE_MAX, width);
- TEST_TRUE(runner, size == SIZE_MAX,
- "Memory_oversize hits ceiling at SIZE_MAX (width %d)", width);
- size = Memory_oversize(SIZE_MAX - 1, width);
- TEST_TRUE(runner, size == SIZE_MAX,
- "Memory_oversize hits ceiling at SIZE_MAX (width %d)", width);
- }
-}
-
-static void
-test_oversize__rounding(TestBatchRunner *runner) {
- int widths[] = { 1, 2, 4, 0 };
-
- for (int width_tick = 0; widths[width_tick] != 0; width_tick++) {
- int width = widths[width_tick];
- for (int i = 0; i < 25; i++) {
- size_t size = Memory_oversize(i, width);
- size_t bytes = size * width;
- if (bytes % sizeof(void*) != 0) {
- FAIL(runner, "Rounding failure for %d, width %d",
- i, width);
- return;
- }
- }
- }
- PASS(runner, "Round allocations up to the size of a pointer");
-}
-
-void
-TestMemory_run(TestMemory *self, TestBatchRunner *runner) {
- TestBatchRunner_Plan(runner, (TestBatch*)self, 30);
- test_oversize__growth_rate(runner);
- test_oversize__ceiling(runner);
- test_oversize__rounding(runner);
-}
-
-
http://git-wip-us.apache.org/repos/asf/lucy/blob/d31a7233/core/Clownfish/Test/Util/TestMemory.cfh
----------------------------------------------------------------------
diff --git a/core/Clownfish/Test/Util/TestMemory.cfh b/core/Clownfish/Test/Util/TestMemory.cfh
deleted file mode 100644
index d0b5803..0000000
--- a/core/Clownfish/Test/Util/TestMemory.cfh
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-
-parcel TestClownfish;
-
-class Clownfish::Test::Util::TestMemory
- inherits Clownfish::TestHarness::TestBatch {
-
- inert incremented TestMemory*
- new();
-
- void
- Run(TestMemory *self, TestBatchRunner *runner);
-}
-
-