lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject [lucy-commits] [05/54] [abbrv] Remove bundled Clownfish.
Date Sat, 26 Apr 2014 23:11:35 GMT
http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Test/TestErr.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/TestErr.c b/clownfish/runtime/core/Clownfish/Test/TestErr.c
deleted file mode 100644
index 5627d7d..0000000
--- a/clownfish/runtime/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/String.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) {
-    String *message = Str_newf("oops");
-    Err *error = Err_new(message);
-    String *string = Err_To_String(error);
-    TEST_TRUE(runner, Str_Equals(message, (Obj*)string),
-              "Stringifies as message");
-    DECREF(string);
-    DECREF(error);
-}
-
-void
-TestErr_Run_IMP(TestErr *self, TestBatchRunner *runner) {
-    TestBatchRunner_Plan(runner, (TestBatch*)self, 1);
-    test_To_String(runner);
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Test/TestErr.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/TestErr.cfh b/clownfish/runtime/core/Clownfish/Test/TestErr.cfh
deleted file mode 100644
index 178017c..0000000
--- a/clownfish/runtime/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/1704c275/clownfish/runtime/core/Clownfish/Test/TestHash.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/TestHash.c b/clownfish/runtime/core/Clownfish/Test/TestHash.c
deleted file mode 100644
index e5000c9..0000000
--- a/clownfish/runtime/core/Clownfish/Test/TestHash.c
+++ /dev/null
@@ -1,234 +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/String.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);
-    StackString *stuff = SSTR_WRAP_UTF8("stuff", 5);
-
-    TEST_TRUE(runner, Hash_Equals(hash, (Obj*)other),
-              "Empty hashes are equal");
-
-    Hash_Store_Utf8(hash, "foo", 3, (Obj*)CFISH_TRUE);
-    TEST_FALSE(runner, Hash_Equals(hash, (Obj*)other),
-               "Add one pair and Equals returns false");
-
-    Hash_Store_Utf8(other, "foo", 3, (Obj*)CFISH_TRUE);
-    TEST_TRUE(runner, Hash_Equals(hash, (Obj*)other),
-              "Add a matching pair and Equals returns true");
-
-    Hash_Store_Utf8(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);
-    StackString *twenty       = SSTR_WRAP_UTF8("20", 2);
-    StackString *forty        = SSTR_WRAP_UTF8("40", 2);
-    StackString *foo          = SSTR_WRAP_UTF8("foo", 3);
-
-    for (int32_t i = 0; i < 100; i++) {
-        String *str = Str_newf("%i32", i);
-        Hash_Store(hash, (Obj*)str, (Obj*)str);
-        Hash_Store(dupe, (Obj*)str, INCREF(str));
-        VA_Push(expected, INCREF(str));
-    }
-    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");
-
-    Obj *stored_foo = INCREF(foo);
-    Hash_Store(hash, (Obj*)forty, stored_foo);
-    TEST_TRUE(runner, SStr_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) == stored_foo,
-              "Delete returns value");
-    DECREF(stored_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++) {
-        String *str = Str_newf("%u32", i);
-        Hash_Store(hash, (Obj*)str, (Obj*)str);
-        VA_Push(expected, INCREF(str));
-    }
-
-    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");
-
-    {
-        StackString *forty = SSTR_WRAP_UTF8("40", 2);
-        StackString *nope  = SSTR_WRAP_UTF8("nope", 4);
-        Obj *key = Hash_Find_Key(hash, (Obj*)forty, SStr_Hash_Sum(forty));
-        TEST_TRUE(runner, Obj_Equals(key, (Obj*)forty), "Find_Key");
-        key = Hash_Find_Key(hash, (Obj*)nope, SStr_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_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++) {
-        String *str = TestUtils_random_string(rand() % 1200);
-        while (Hash_Fetch(hash, (Obj*)str)) {
-            DECREF(str);
-            str = TestUtils_random_string(rand() % 1200);
-        }
-        Hash_Store(hash, (Obj*)str, (Obj*)str);
-        VA_Push(expected, INCREF(str));
-    }
-
-    VA_Sort(expected, NULL, NULL);
-
-    // Overwrite for good measure.
-    for (uint32_t i = 0; i < 1000; i++) {
-        String *str = (String*)VA_Fetch(expected, i);
-        Hash_Store(hash, (Obj*)str, INCREF(str));
-    }
-
-    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_IMP(TestHash *self, TestBatchRunner *runner) {
-    TestBatchRunner_Plan(runner, (TestBatch*)self, 27);
-    srand((unsigned int)time((time_t*)NULL));
-    test_Equals(runner);
-    test_Store_and_Fetch(runner);
-    test_Keys_Values_Iter(runner);
-    test_stress(runner);
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Test/TestHash.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/TestHash.cfh b/clownfish/runtime/core/Clownfish/Test/TestHash.cfh
deleted file mode 100644
index a730105..0000000
--- a/clownfish/runtime/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/1704c275/clownfish/runtime/core/Clownfish/Test/TestLockFreeRegistry.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/TestLockFreeRegistry.c b/clownfish/runtime/core/Clownfish/Test/TestLockFreeRegistry.c
deleted file mode 100644
index 515db9a..0000000
--- a/clownfish/runtime/core/Clownfish/Test/TestLockFreeRegistry.c
+++ /dev/null
@@ -1,85 +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 "charmony.h"
-
-#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*)Str_new_from_utf8(text, strlen(text));
-}
-
-int32_t
-StupidHashCharBuf_Hash_Sum_IMP(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_IMP(TestLockFreeRegistry *self, TestBatchRunner *runner) {
-    TestBatchRunner_Plan(runner, (TestBatch*)self, 6);
-    test_all(runner);
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Test/TestLockFreeRegistry.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/TestLockFreeRegistry.cfh b/clownfish/runtime/core/Clownfish/Test/TestLockFreeRegistry.cfh
deleted file mode 100644
index 80db8af..0000000
--- a/clownfish/runtime/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::String {
-    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/1704c275/clownfish/runtime/core/Clownfish/Test/TestNum.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/TestNum.c b/clownfish/runtime/core/Clownfish/Test/TestNum.c
deleted file mode 100644
index f84c2c0..0000000
--- a/clownfish/runtime/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/String.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);
-    String *f32_string = Float32_To_String(f32);
-    String *f64_string = Float64_To_String(f64);
-    String *i32_string = Int32_To_String(i32);
-    String *i64_string = Int64_To_String(i64);
-    String *true_string  = Bool_To_String(CFISH_TRUE);
-    String *false_string = Bool_To_String(CFISH_FALSE);
-
-    TEST_TRUE(runner, Str_Starts_With_Utf8(f32_string, "1.3", 3),
-              "Float32_To_String");
-    TEST_TRUE(runner, Str_Starts_With_Utf8(f64_string, "1.3", 3),
-              "Float64_To_String");
-    TEST_TRUE(runner, Str_Equals_Utf8(i32_string, "2147483647", 10),
-              "Int32_To_String");
-    TEST_TRUE(runner, Str_Equals_Utf8(i64_string, "9223372036854775807", 19),
-              "Int64_To_String");
-    TEST_TRUE(runner, Str_Equals_Utf8(true_string, "true", 4),
-              "Bool_To_String [true]");
-    TEST_TRUE(runner, Str_Equals_Utf8(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*)STRING),
-               "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_IMP(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/1704c275/clownfish/runtime/core/Clownfish/Test/TestNum.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/TestNum.cfh b/clownfish/runtime/core/Clownfish/Test/TestNum.cfh
deleted file mode 100644
index 6d1f663..0000000
--- a/clownfish/runtime/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/1704c275/clownfish/runtime/core/Clownfish/Test/TestObj.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/TestObj.c b/clownfish/runtime/core/Clownfish/Test/TestObj.c
deleted file mode 100644
index 63e2bae..0000000
--- a/clownfish/runtime/core/Clownfish/Test/TestObj.c
+++ /dev/null
@@ -1,182 +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 "charmony.h"
-
-#include "Clownfish/Test/TestObj.h"
-
-#include "Clownfish/String.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() {
-    StackString *klass = SSTR_WRAP_UTF8("TestObj", 7);
-    Obj *obj;
-    VTable *vtable = VTable_fetch_vtable((String*)klass);
-    if (!vtable) {
-        vtable = VTable_singleton((String*)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 = 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();
-    String *string = Obj_To_String(testobj);
-    TEST_TRUE(runner, Str_Find_Utf8(string, "TestObj", 7) >= 0, "To_String");
-    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) {
-    String *string     = Str_new_from_trusted_utf8("", 0);
-    VTable *str_vtable = Str_Get_VTable(string);
-    String *klass      = Str_Get_Class_Name(string);
-
-    TEST_TRUE(runner, Str_Is_A(string, STRING), "String Is_A String.");
-    TEST_TRUE(runner, Str_Is_A(string, OBJ), "String Is_A Obj.");
-    TEST_TRUE(runner, str_vtable == STRING, "Get_VTable");
-    TEST_TRUE(runner, Str_Equals(VTable_Get_Name(STRING), (Obj*)klass),
-              "Get_Class_Name");
-
-    DECREF(string);
-}
-
-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_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_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) 
-              && Str_Find_Utf8(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_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_Mimic,      obj, "Mimic");
-    DECREF(obj);
-}
-
-void
-TestObj_Run_IMP(TestObj *self, TestBatchRunner *runner) {
-    TestBatchRunner_Plan(runner, (TestBatch*)self, 17);
-    test_refcounts(runner);
-    test_To_String(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/1704c275/clownfish/runtime/core/Clownfish/Test/TestObj.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/TestObj.cfh b/clownfish/runtime/core/Clownfish/Test/TestObj.cfh
deleted file mode 100644
index eb4a0b6..0000000
--- a/clownfish/runtime/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/1704c275/clownfish/runtime/core/Clownfish/Test/TestString.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/TestString.c b/clownfish/runtime/core/Clownfish/Test/TestString.c
deleted file mode 100644
index 634154a..0000000
--- a/clownfish/runtime/core/Clownfish/Test/TestString.c
+++ /dev/null
@@ -1,527 +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 "charmony.h"
-
-#include "Clownfish/Test/TestString.h"
-
-#include "Clownfish/String.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/Util/Memory.h"
-#include "Clownfish/VTable.h"
-
-#define SMILEY "\xE2\x98\xBA"
-static char smiley[] = { (char)0xE2, (char)0x98, (char)0xBA, 0 };
-static uint32_t smiley_len = 3;
-static uint32_t smiley_cp  = 0x263A;
-
-TestString*
-TestStr_new() {
-    return (TestString*)VTable_Make_Obj(TESTSTRING);
-}
-
-static String*
-S_get_str(const char *string) {
-    return Str_new_from_utf8(string, strlen(string));
-}
-
-// Surround a smiley with lots of whitespace.
-static String*
-S_smiley_with_whitespace(int *num_spaces_ptr) {
-    int32_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
-    };
-    int num_spaces = sizeof(spaces) / sizeof(uint32_t);
-
-    CharBuf *buf = CB_new(0);
-    for (int i = 0; i < num_spaces; i++) { CB_Cat_Char(buf, spaces[i]); }
-    CB_Cat_Char(buf, smiley_cp);
-    for (int i = 0; i < num_spaces; i++) { CB_Cat_Char(buf, spaces[i]); }
-
-    String *retval = CB_To_String(buf);
-    if (num_spaces_ptr) { *num_spaces_ptr = num_spaces; }
-
-    DECREF(buf);
-    return retval;
-}
-
-static void
-test_Cat(TestBatchRunner *runner) {
-    String *wanted = Str_newf("a%s", smiley);
-    String *source;
-    String *got;
-
-    source = S_get_str("");
-    got = Str_Cat(source, wanted);
-    TEST_TRUE(runner, Str_Equals(wanted, (Obj*)got), "Cat");
-    DECREF(got);
-    DECREF(source);
-
-    source = S_get_str("a");
-    got = Str_Cat_Utf8(source, smiley, smiley_len);
-    TEST_TRUE(runner, Str_Equals(wanted, (Obj*)got), "Cat_Utf8");
-    DECREF(got);
-    DECREF(source);
-
-    source = S_get_str("a");
-    got = Str_Cat_Trusted_Utf8(source, smiley, smiley_len);
-    TEST_TRUE(runner, Str_Equals(wanted, (Obj*)got), "Cat_Trusted_Utf8");
-    DECREF(got);
-    DECREF(source);
-
-    DECREF(wanted);
-}
-
-static void
-test_Clone(TestBatchRunner *runner) {
-    String *wanted = S_get_str("foo");
-    String *got    = S_get_str("bar");
-
-    got = Str_Clone(wanted);
-    TEST_TRUE(runner, Str_Equals(wanted, (Obj*)got), "Clone");
-    DECREF(got);
-
-    DECREF(wanted);
-}
-
-static void
-test_Find(TestBatchRunner *runner) {
-    String *string;
-    String *substring = S_get_str("foo");
-
-    string = S_get_str("");
-    TEST_TRUE(runner, Str_Find(string, substring) == -1, "Not in empty string");
-    DECREF(string);
-
-    string = S_get_str("foo");
-    TEST_TRUE(runner, Str_Find(string, substring) == 0, "Find complete string");
-    DECREF(string);
-
-    string = S_get_str("afoo");
-    TEST_TRUE(runner, Str_Find(string, substring) == 1, "Find after first");
-    // TODO: Enable this test when we have real substrings.
-    /*Str_Set_Size(string, 3);
-    TEST_TRUE(runner, Str_Find(string, substring) == -1, "Don't overrun");*/
-    DECREF(string);
-
-    string = S_get_str("afood");
-    TEST_TRUE(runner, Str_Find(string, substring) == 1, "Find in middle");
-    DECREF(string);
-
-    DECREF(substring);
-}
-
-static void
-test_Code_Point_At_and_From(TestBatchRunner *runner) {
-    int32_t code_points[] = {
-        'a', smiley_cp, smiley_cp, 'b', smiley_cp, 'c'
-    };
-    uint32_t num_code_points = sizeof(code_points) / sizeof(int32_t);
-    String *string = Str_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;
-        TEST_INT_EQ(runner, Str_Code_Point_At(string, i), code_points[i],
-                    "Code_Point_At %ld", (long)i);
-        TEST_INT_EQ(runner, Str_Code_Point_From(string, from),
-                    code_points[i], "Code_Point_From %ld", (long)from);
-    }
-
-    DECREF(string);
-}
-
-static void
-test_SubString(TestBatchRunner *runner) {
-    String *string = Str_newf("a%s%sb%sc", smiley, smiley, smiley);
-    String *wanted = Str_newf("%sb%s", smiley, smiley);
-    String *got = Str_SubString(string, 2, 3);
-    TEST_TRUE(runner, Str_Equals(wanted, (Obj*)got), "SubString");
-    DECREF(wanted);
-    DECREF(got);
-    DECREF(string);
-}
-
-static void
-test_Trim(TestBatchRunner *runner) {
-    String *ws_smiley = S_smiley_with_whitespace(NULL);
-    String *ws_foo    = S_get_str("  foo  ");
-    String *ws_only   = S_get_str("  \t  \r\n");
-    String *trimmed   = S_get_str("a     b");
-    String *got;
-
-    got = Str_Trim(ws_smiley);
-    TEST_TRUE(runner, Str_Equals_Utf8(got, smiley, smiley_len), "Trim");
-    DECREF(got);
-
-    got = Str_Trim_Top(ws_foo);
-    TEST_TRUE(runner, Str_Equals_Utf8(got, "foo  ", 5), "Trim_Top");
-    DECREF(got);
-
-    got = Str_Trim_Tail(ws_foo);
-    TEST_TRUE(runner, Str_Equals_Utf8(got, "  foo", 5), "Trim_Tail");
-    DECREF(got);
-
-    got = Str_Trim(ws_only);
-    TEST_TRUE(runner, Str_Equals_Utf8(got, "", 0), "Trim with only whitespace");
-    DECREF(got);
-
-    got = Str_Trim_Top(ws_only);
-    TEST_TRUE(runner, Str_Equals_Utf8(got, "", 0),
-              "Trim_Top with only whitespace");
-    DECREF(got);
-
-    got = Str_Trim_Tail(ws_only);
-    TEST_TRUE(runner, Str_Equals_Utf8(got, "", 0),
-              "Trim_Tail with only whitespace");
-    DECREF(got);
-
-    got = Str_Trim(trimmed);
-    TEST_TRUE(runner, Str_Equals(got, (Obj*)trimmed),
-              "Trim doesn't change trimmed string");
-    DECREF(got);
-
-    got = Str_Trim_Top(trimmed);
-    TEST_TRUE(runner, Str_Equals(got, (Obj*)trimmed),
-              "Trim_Top doesn't change trimmed string");
-    DECREF(got);
-
-    got = Str_Trim_Tail(trimmed);
-    TEST_TRUE(runner, Str_Equals(got, (Obj*)trimmed),
-              "Trim_Tail doesn't change trimmed string");
-    DECREF(got);
-
-    DECREF(trimmed);
-    DECREF(ws_only);
-    DECREF(ws_foo);
-    DECREF(ws_smiley);
-}
-
-static void
-test_To_F64(TestBatchRunner *runner) {
-    String *string;
-
-    string = S_get_str("1.5");
-    double difference = 1.5 - Str_To_F64(string);
-    if (difference < 0) { difference = 0 - difference; }
-    TEST_TRUE(runner, difference < 0.001, "To_F64");
-    DECREF(string);
-
-    string = S_get_str("-1.5");
-    difference = 1.5 + Str_To_F64(string);
-    if (difference < 0) { difference = 0 - difference; }
-    TEST_TRUE(runner, difference < 0.001, "To_F64 negative");
-    DECREF(string);
-
-    // TODO: Enable this test when we have real substrings.
-    /*string = S_get_str("1.59");
-    double value_full = Str_To_F64(string);
-    Str_Set_Size(string, 3);
-    double value_short = Str_To_F64(string);
-    TEST_TRUE(runner, value_short < value_full,
-              "TO_F64 doesn't run past end of string");
-    DECREF(string);*/
-}
-
-static void
-test_To_I64(TestBatchRunner *runner) {
-    String *string;
-
-    string = S_get_str("10");
-    TEST_TRUE(runner, Str_To_I64(string) == 10, "To_I64");
-    DECREF(string);
-
-    string = S_get_str("-10");
-    TEST_TRUE(runner, Str_To_I64(string) == -10, "To_I64 negative");
-    DECREF(string);
-}
-
-static void
-test_To_Utf8(TestBatchRunner *runner) {
-    String *string = Str_newf("a%s%sb%sc", smiley, smiley, smiley);
-    char *buf = Str_To_Utf8(string);
-    TEST_TRUE(runner, strcmp(buf, "a" SMILEY SMILEY "b" SMILEY "c") == 0,
-              "To_Utf8");
-    FREEMEM(buf);
-    DECREF(string);
-}
-
-static void
-test_Length(TestBatchRunner *runner) {
-    String *string = Str_newf("a%s%sb%sc", smiley, smiley, smiley);
-    TEST_INT_EQ(runner, Str_Length(string), 6, "Length");
-    DECREF(string);
-}
-
-static void
-test_Compare_To(TestBatchRunner *runner) {
-    String *abc = Str_newf("a%s%sb%sc", smiley, smiley, smiley);
-    String *ab  = Str_newf("a%s%sb", smiley, smiley);
-    String *ac  = Str_newf("a%s%sc", smiley, smiley);
-
-    TEST_TRUE(runner, Str_Compare_To(abc, (Obj*)abc) == 0,
-              "Compare_To abc abc");
-    TEST_TRUE(runner, Str_Compare_To(ab, (Obj*)abc) < 0,
-              "Compare_To ab abc");
-    TEST_TRUE(runner, Str_Compare_To(abc, (Obj*)ab) > 0,
-              "Compare_To abc ab");
-    TEST_TRUE(runner, Str_Compare_To(ab, (Obj*)ac) < 0,
-              "Compare_To ab ac");
-    TEST_TRUE(runner, Str_Compare_To(ac, (Obj*)ab) > 0,
-              "Compare_To ac ab");
-
-    DECREF(ac);
-    DECREF(ab);
-    DECREF(abc);
-}
-
-static void
-test_Swap_Chars(TestBatchRunner *runner) {
-    String *source = S_get_str("aXXbXc");
-    String *got    = Str_Swap_Chars(source, 'X', smiley_cp);
-    String *wanted = Str_newf("a%s%sb%sc", smiley, smiley, smiley);
-    TEST_TRUE(runner, Str_Equals(got, (Obj*)wanted), "Swap_Chars");
-    DECREF(wanted);
-    DECREF(got);
-    DECREF(source);
-}
-
-static void
-test_iterator(TestBatchRunner *runner) {
-    static const int32_t code_points[] = {
-        0x41,
-        0x7F,
-        0x80,
-        0x7FF,
-        0x800,
-        0xFFFF,
-        0x10000,
-        0x10FFFF
-    };
-    static size_t num_code_points
-        = sizeof(code_points) / sizeof(code_points[0]);
-
-    CharBuf *buf = CB_new(0);
-    for (size_t i = 0; i < num_code_points; ++i) {
-        CB_Cat_Char(buf, code_points[i]);
-    }
-    String *string = CB_To_String(buf);
-
-    {
-        StringIterator *top  = Str_Top(string);
-        StringIterator *tail = Str_Tail(string);
-
-        TEST_INT_EQ(runner, StrIter_Compare_To(top, (Obj*)tail), -1,
-                    "Compare_To top < tail");
-        TEST_INT_EQ(runner, StrIter_Compare_To(tail, (Obj*)top), 1,
-                    "Compare_To tail > top");
-        TEST_INT_EQ(runner, StrIter_Compare_To(top, (Obj*)top), 0,
-                    "Compare_To top == top");
-
-        StringIterator *clone = StrIter_Clone(top);
-        TEST_TRUE(runner, StrIter_Equals(clone, (Obj*)top), "Clone");
-
-        StrIter_Assign(clone, tail);
-        TEST_TRUE(runner, StrIter_Equals(clone, (Obj*)tail), "Assign");
-
-        DECREF(clone);
-        DECREF(top);
-        DECREF(tail);
-    }
-
-    {
-        StringIterator *iter = Str_Top(string);
-
-        for (size_t i = 0; i < num_code_points; ++i) {
-            TEST_TRUE(runner, StrIter_Has_Next(iter), "Has_Next %d", i);
-            int32_t code_point = StrIter_Next(iter);
-            TEST_INT_EQ(runner, code_point, code_points[i], "Next %d", i);
-        }
-
-        TEST_TRUE(runner, !StrIter_Has_Next(iter),
-                  "Has_Next at end of string");
-        TEST_INT_EQ(runner, StrIter_Next(iter), STRITER_DONE,
-                    "Next at end of string");
-
-        StringIterator *tail = Str_Tail(string);
-        TEST_TRUE(runner, StrIter_Equals(iter, (Obj*)tail), "Equals tail");
-
-        DECREF(tail);
-        DECREF(iter);
-    }
-
-    {
-        StringIterator *iter = Str_Tail(string);
-
-        for (int i = num_code_points - 1; i >= 0; --i) {
-            TEST_TRUE(runner, StrIter_Has_Prev(iter), "Has_Prev %d", i);
-            int32_t code_point = StrIter_Prev(iter);
-            TEST_INT_EQ(runner, code_point, code_points[i], "Prev %d", i);
-        }
-
-        TEST_TRUE(runner, !StrIter_Has_Prev(iter),
-                  "Has_Prev at end of string");
-        TEST_INT_EQ(runner, StrIter_Prev(iter), STRITER_DONE,
-                    "Prev at start of string");
-
-        StringIterator *top = Str_Top(string);
-        TEST_TRUE(runner, StrIter_Equals(iter, (Obj*)top), "Equals top");
-
-        DECREF(top);
-        DECREF(iter);
-    }
-
-    {
-        StringIterator *iter = Str_Top(string);
-
-        StrIter_Next(iter);
-        TEST_INT_EQ(runner, StrIter_Advance(iter, 2), 2,
-                    "Advance returns number of code points");
-        TEST_INT_EQ(runner, StrIter_Next(iter), code_points[3],
-                    "Advance works");
-        TEST_INT_EQ(runner,
-                    StrIter_Advance(iter, 1000000), num_code_points - 4,
-                    "Advance past end of string");
-
-        StrIter_Prev(iter);
-        TEST_INT_EQ(runner, StrIter_Recede(iter, 2), 2,
-                    "Recede returns number of code points");
-        TEST_INT_EQ(runner, StrIter_Prev(iter), code_points[num_code_points-4],
-                    "Recede works");
-        TEST_INT_EQ(runner, StrIter_Recede(iter, 1000000), num_code_points - 4,
-                    "Recede past start of string");
-
-        DECREF(iter);
-    }
-
-    DECREF(string);
-    DECREF(buf);
-}
-
-static void
-test_iterator_whitespace(TestBatchRunner *runner) {
-    int num_spaces;
-    String *ws_smiley = S_smiley_with_whitespace(&num_spaces);
-
-    {
-        StringIterator *iter = Str_Top(ws_smiley);
-        TEST_INT_EQ(runner, StrIter_Skip_Next_Whitespace(iter), num_spaces,
-                    "Skip_Next_Whitespace");
-        TEST_INT_EQ(runner, StrIter_Skip_Next_Whitespace(iter), 0,
-                    "Skip_Next_Whitespace without whitespace");
-        DECREF(iter);
-    }
-
-    {
-        StringIterator *iter = Str_Tail(ws_smiley);
-        TEST_INT_EQ(runner, StrIter_Skip_Prev_Whitespace(iter), num_spaces,
-                    "Skip_Prev_Whitespace");
-        TEST_INT_EQ(runner, StrIter_Skip_Prev_Whitespace(iter), 0,
-                    "Skip_Prev_Whitespace without whitespace");
-        DECREF(iter);
-    }
-
-    DECREF(ws_smiley);
-}
-
-static void
-test_iterator_substring(TestBatchRunner *runner) {
-    String *string = Str_newf("a%sb%sc%sd", smiley, smiley, smiley);
-
-    StringIterator *start = Str_Top(string);
-    StringIterator *end = Str_Tail(string);
-
-    {
-        String *substring = StrIter_substring(start, end);
-        TEST_TRUE(runner, Str_Equals(substring, (Obj*)string),
-                  "StrIter_substring whole string");
-        DECREF(substring);
-    }
-
-    StrIter_Advance(start, 2);
-    StrIter_Recede(end, 2);
-
-    {
-        String *substring = StrIter_substring(start, end);
-        String *wanted = Str_newf("b%sc", smiley);
-        TEST_TRUE(runner, Str_Equals(substring, (Obj*)wanted),
-                  "StrIter_substring");
-
-        TEST_TRUE(runner, StrIter_Starts_With(start, wanted), "Starts_With");
-        TEST_TRUE(runner, StrIter_Ends_With(end, wanted), "Ends_With");
-
-        DECREF(wanted);
-        DECREF(substring);
-    }
-
-    {
-        String *substring = StrIter_substring(end, NULL);
-        String *wanted = Str_newf("%sd", smiley);
-        TEST_TRUE(runner, Str_Equals(substring, (Obj*)wanted),
-                  "StrIter_substring with NULL tail");
-        DECREF(wanted);
-        DECREF(substring);
-    }
-
-    {
-        String *substring = StrIter_substring(NULL, start);
-        String *wanted = Str_newf("a%s", smiley);
-        TEST_TRUE(runner, Str_Equals(substring, (Obj*)wanted),
-                  "StrIter_substring with NULL top");
-        DECREF(wanted);
-        DECREF(substring);
-    }
-
-    DECREF(start);
-    DECREF(end);
-    DECREF(string);
-}
-
-void
-TestStr_Run_IMP(TestString *self, TestBatchRunner *runner) {
-    TestBatchRunner_Plan(runner, (TestBatch*)self, 101);
-    test_Cat(runner);
-    test_Clone(runner);
-    test_Code_Point_At_and_From(runner);
-    test_Find(runner);
-    test_SubString(runner);
-    test_Trim(runner);
-    test_To_F64(runner);
-    test_To_I64(runner);
-    test_To_Utf8(runner);
-    test_Length(runner);
-    test_Compare_To(runner);
-    test_Swap_Chars(runner);
-    test_iterator(runner);
-    test_iterator_whitespace(runner);
-    test_iterator_substring(runner);
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Test/TestString.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/TestString.cfh b/clownfish/runtime/core/Clownfish/Test/TestString.cfh
deleted file mode 100644
index aaf1289..0000000
--- a/clownfish/runtime/core/Clownfish/Test/TestString.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::TestString cnick TestStr
-    inherits Clownfish::TestHarness::TestBatch {
-
-    inert incremented TestString*
-    new();
-
-    void
-    Run(TestString *self, TestBatchRunner *runner);
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Test/TestVArray.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/TestVArray.c b/clownfish/runtime/core/Clownfish/Test/TestVArray.c
deleted file mode 100644
index 06c1590..0000000
--- a/clownfish/runtime/core/Clownfish/Test/TestVArray.c
+++ /dev/null
@@ -1,312 +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 "charmony.h"
-
-#include "Clownfish/Test/TestVArray.h"
-
-#include "Clownfish/String.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 void
-test_Equals(TestBatchRunner *runner) {
-    VArray *array = VA_new(0);
-    VArray *other = VA_new(0);
-    StackString *stuff = SSTR_WRAP_UTF8("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);
-    String *elem;
-
-    TEST_TRUE(runner, VA_Fetch(array, 2) == NULL, "Fetch beyond end");
-
-    VA_Store(array, 2, (Obj*)Str_newf("foo"));
-    elem = (String*)CERTIFY(VA_Fetch(array, 2), STRING);
-    TEST_INT_EQ(runner, 3, VA_Get_Size(array), "Store updates size");
-    TEST_TRUE(runner, Str_Equals_Utf8(elem, "foo", 3), "Store");
-
-    elem = (String*)INCREF(elem);
-    TEST_INT_EQ(runner, 2, Str_Get_RefCount(elem),
-                "start with refcount of 2");
-    VA_Store(array, 2, (Obj*)Str_newf("bar"));
-    TEST_INT_EQ(runner, 1, Str_Get_RefCount(elem),
-                "Displacing elem via Store updates refcount");
-    DECREF(elem);
-    elem = (String*)CERTIFY(VA_Fetch(array, 2), STRING);
-    TEST_TRUE(runner, Str_Equals_Utf8(elem, "bar", 3), "Store displacement");
-
-    DECREF(array);
-}
-
-static void
-test_Push_Pop_Shift_Unshift(TestBatchRunner *runner) {
-    VArray *array = VA_new(0);
-    String *elem;
-
-    TEST_INT_EQ(runner, VA_Get_Size(array), 0, "size starts at 0");
-    VA_Push(array, (Obj*)Str_newf("a"));
-    VA_Push(array, (Obj*)Str_newf("b"));
-    VA_Push(array, (Obj*)Str_newf("c"));
-
-    TEST_INT_EQ(runner, VA_Get_Size(array), 3, "size after Push");
-    TEST_TRUE(runner, NULL != CERTIFY(VA_Fetch(array, 2), STRING), "Push");
-
-    elem = (String*)CERTIFY(VA_Shift(array), STRING);
-    TEST_TRUE(runner, Str_Equals_Utf8(elem, "a", 1), "Shift");
-    TEST_INT_EQ(runner, VA_Get_Size(array), 2, "size after Shift");
-    DECREF(elem);
-
-    elem = (String*)CERTIFY(VA_Pop(array), STRING);
-    TEST_TRUE(runner, Str_Equals_Utf8(elem, "c", 1), "Pop");
-    TEST_INT_EQ(runner, VA_Get_Size(array), 1, "size after Pop");
-    DECREF(elem);
-
-    VA_Unshift(array, (Obj*)Str_newf("foo"));
-    elem = (String*)CERTIFY(VA_Fetch(array, 0), STRING);
-    TEST_TRUE(runner, Str_Equals_Utf8(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*)Str_newf("%u32", i)); }
-    VA_Store(wanted, 0, (Obj*)Str_newf("0", i));
-    VA_Store(wanted, 1, (Obj*)Str_newf("1", i));
-    VA_Store(wanted, 4, (Obj*)Str_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*)Str_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*)Str_newf("%u32", i));
-        VA_Push(got, (Obj*)Str_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*)Str_newf("%u32", i)); }
-    for (i = 0; i < 2; i++) { VA_Push(got, (Obj*)Str_newf("%u32", i)); }
-    for (i = 2; i < 4; i++) { VA_Push(scratch, (Obj*)Str_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*)Str_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*)Str_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*)Str_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*)Int32_new(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);
-}
-
-void
-TestVArray_Run_IMP(TestVArray *self, TestBatchRunner *runner) {
-    TestBatchRunner_Plan(runner, (TestBatch*)self, 43);
-    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);
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Test/TestVArray.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/TestVArray.cfh b/clownfish/runtime/core/Clownfish/Test/TestVArray.cfh
deleted file mode 100644
index 735fccb..0000000
--- a/clownfish/runtime/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/1704c275/clownfish/runtime/core/Clownfish/Test/Util/TestAtomic.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/Util/TestAtomic.c b/clownfish/runtime/core/Clownfish/Test/Util/TestAtomic.c
deleted file mode 100644
index 320ff91..0000000
--- a/clownfish/runtime/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_IMP(TestAtomic *self, TestBatchRunner *runner) {
-    TestBatchRunner_Plan(runner, (TestBatch*)self, 6);
-    test_cas_ptr(runner);
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Test/Util/TestAtomic.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/Util/TestAtomic.cfh b/clownfish/runtime/core/Clownfish/Test/Util/TestAtomic.cfh
deleted file mode 100644
index 2788342..0000000
--- a/clownfish/runtime/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/1704c275/clownfish/runtime/core/Clownfish/Test/Util/TestMemory.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/Util/TestMemory.c b/clownfish/runtime/core/Clownfish/Test/Util/TestMemory.c
deleted file mode 100644
index 1878242..0000000
--- a/clownfish/runtime/core/Clownfish/Test/Util/TestMemory.c
+++ /dev/null
@@ -1,120 +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 "charmony.h"
-
-#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_IMP(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/1704c275/clownfish/runtime/core/Clownfish/Test/Util/TestMemory.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/Util/TestMemory.cfh b/clownfish/runtime/core/Clownfish/Test/Util/TestMemory.cfh
deleted file mode 100644
index d0b5803..0000000
--- a/clownfish/runtime/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);
-}
-
-


Mime
View raw message