You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2012/10/03 20:58:48 UTC
[lucy-commits] svn commit: r1393674 - in /lucy/trunk/clownfish/runtime/core/Clownfish/Test:
TestByteBuf.c TestCharBuf.c TestHash.c TestNum.c TestVArray.c
Author: marvin
Date: Wed Oct 3 18:58:47 2012
New Revision: 1393674
URL: http://svn.apache.org/viewvc?rev=1393674&view=rev
Log:
Remove serialization tests.
Modified:
lucy/trunk/clownfish/runtime/core/Clownfish/Test/TestByteBuf.c
lucy/trunk/clownfish/runtime/core/Clownfish/Test/TestCharBuf.c
lucy/trunk/clownfish/runtime/core/Clownfish/Test/TestHash.c
lucy/trunk/clownfish/runtime/core/Clownfish/Test/TestNum.c
lucy/trunk/clownfish/runtime/core/Clownfish/Test/TestVArray.c
Modified: lucy/trunk/clownfish/runtime/core/Clownfish/Test/TestByteBuf.c
URL: http://svn.apache.org/viewvc/lucy/trunk/clownfish/runtime/core/Clownfish/Test/TestByteBuf.c?rev=1393674&r1=1393673&r2=1393674&view=diff
==============================================================================
--- lucy/trunk/clownfish/runtime/core/Clownfish/Test/TestByteBuf.c (original)
+++ lucy/trunk/clownfish/runtime/core/Clownfish/Test/TestByteBuf.c Wed Oct 3 18:58:47 2012
@@ -133,19 +133,9 @@ test_Cat(TestBatch *batch) {
DECREF(wanted);
}
-static void
-test_serialization(TestBatch *batch) {
- ByteBuf *wanted = BB_new_bytes("foobar", 6);
- ByteBuf *got = (ByteBuf*)TestUtils_freeze_thaw((Obj*)wanted);
- TEST_TRUE(batch, got && BB_Equals(wanted, (Obj*)got),
- "Serialization round trip");
- DECREF(wanted);
- DECREF(got);
-}
-
void
TestBB_run_tests() {
- TestBatch *batch = TestBatch_new(22);
+ TestBatch *batch = TestBatch_new(21);
TestBatch_Plan(batch);
test_Equals(batch);
@@ -154,7 +144,6 @@ TestBB_run_tests() {
test_compare(batch);
test_Mimic(batch);
test_Cat(batch);
- test_serialization(batch);
DECREF(batch);
}
Modified: lucy/trunk/clownfish/runtime/core/Clownfish/Test/TestCharBuf.c
URL: http://svn.apache.org/viewvc/lucy/trunk/clownfish/runtime/core/Clownfish/Test/TestCharBuf.c?rev=1393674&r1=1393673&r2=1393674&view=diff
==============================================================================
--- lucy/trunk/clownfish/runtime/core/Clownfish/Test/TestCharBuf.c (original)
+++ lucy/trunk/clownfish/runtime/core/Clownfish/Test/TestCharBuf.c Wed Oct 3 18:58:47 2012
@@ -386,19 +386,9 @@ test_vcatf_x32(TestBatch *batch) {
DECREF(got);
}
-static void
-test_serialization(TestBatch *batch) {
- CharBuf *wanted = S_get_cb("foo");
- CharBuf *got = (CharBuf*)TestUtils_freeze_thaw((Obj*)wanted);
- TEST_TRUE(batch, got && CB_Equals(wanted, (Obj*)got),
- "Round trip through FREEZE/THAW");
- DECREF(got);
- DECREF(wanted);
-}
-
void
TestCB_run_tests() {
- TestBatch *batch = TestBatch_new(55);
+ TestBatch *batch = TestBatch_new(54);
TestBatch_Plan(batch);
test_vcatf_s(batch);
@@ -424,7 +414,6 @@ TestCB_run_tests() {
test_Trim(batch);
test_To_F64(batch);
test_To_I64(batch);
- test_serialization(batch);
DECREF(batch);
}
Modified: lucy/trunk/clownfish/runtime/core/Clownfish/Test/TestHash.c
URL: http://svn.apache.org/viewvc/lucy/trunk/clownfish/runtime/core/Clownfish/Test/TestHash.c?rev=1393674&r1=1393673&r2=1393674&view=diff
==============================================================================
--- lucy/trunk/clownfish/runtime/core/Clownfish/Test/TestHash.c (original)
+++ lucy/trunk/clownfish/runtime/core/Clownfish/Test/TestHash.c Wed Oct 3 18:58:47 2012
@@ -207,26 +207,6 @@ test_Dump_and_Load(TestBatch *batch) {
}
static void
-test_serialization(TestBatch *batch) {
- Hash *wanted = Hash_new(0);
- Hash *got;
-
- for (uint32_t i = 0; i < 10; i++) {
- CharBuf *cb = TestUtils_random_string(rand() % 1200);
- Integer32 *num = Int32_new(i);
- Hash_Store(wanted, (Obj*)cb, (Obj*)num);
- Hash_Store(wanted, (Obj*)num, (Obj*)cb);
- }
-
- got = (Hash*)TestUtils_freeze_thaw((Obj*)wanted);
- TEST_TRUE(batch, got && Hash_Equals(wanted, (Obj*)got),
- "Round trip through serialization.");
-
- DECREF(got);
- DECREF(wanted);
-}
-
-static void
test_stress(TestBatch *batch) {
Hash *hash = Hash_new(0); // trigger multiple rebuilds.
VArray *expected = VA_new(1000);
@@ -266,7 +246,7 @@ test_stress(TestBatch *batch) {
void
TestHash_run_tests() {
- TestBatch *batch = TestBatch_new(29);
+ TestBatch *batch = TestBatch_new(28);
srand((unsigned int)time((time_t*)NULL));
@@ -275,7 +255,6 @@ TestHash_run_tests() {
test_Store_and_Fetch(batch);
test_Keys_Values_Iter(batch);
test_Dump_and_Load(batch);
- test_serialization(batch);
test_stress(batch);
DECREF(batch);
Modified: lucy/trunk/clownfish/runtime/core/Clownfish/Test/TestNum.c
URL: http://svn.apache.org/viewvc/lucy/trunk/clownfish/runtime/core/Clownfish/Test/TestNum.c?rev=1393674&r1=1393673&r2=1393674&view=diff
==============================================================================
--- lucy/trunk/clownfish/runtime/core/Clownfish/Test/TestNum.c (original)
+++ lucy/trunk/clownfish/runtime/core/Clownfish/Test/TestNum.c Wed Oct 3 18:58:47 2012
@@ -266,42 +266,9 @@ test_Mimic(TestBatch *batch) {
DECREF(f32);
}
-static void
-test_serialization(TestBatch *batch) {
- Float32 *f32 = Float32_new(1.33f);
- Float64 *f64 = Float64_new(1.33);
- Integer32 *i32 = Int32_new(-1);
- Integer64 *i64 = Int64_new(-1);
- Float32 *f32_thaw = (Float32*)TestUtils_freeze_thaw((Obj*)f32);
- Float64 *f64_thaw = (Float64*)TestUtils_freeze_thaw((Obj*)f64);
- Integer32 *i32_thaw = (Integer32*)TestUtils_freeze_thaw((Obj*)i32);
- Integer64 *i64_thaw = (Integer64*)TestUtils_freeze_thaw((Obj*)i64);
- BoolNum *true_thaw = (BoolNum*)TestUtils_freeze_thaw((Obj*)CFISH_TRUE);
-
- TEST_TRUE(batch, Float32_Equals(f32, (Obj*)f32_thaw),
- "Float32 freeze/thaw");
- TEST_TRUE(batch, Float64_Equals(f64, (Obj*)f64_thaw),
- "Float64 freeze/thaw");
- TEST_TRUE(batch, Int32_Equals(i32, (Obj*)i32_thaw),
- "Integer32 freeze/thaw");
- TEST_TRUE(batch, Int64_Equals(i64, (Obj*)i64_thaw),
- "Integer64 freeze/thaw");
- TEST_TRUE(batch, Bool_Equals(CFISH_TRUE, (Obj*)true_thaw),
- "BoolNum freeze/thaw");
-
- DECREF(i64_thaw);
- DECREF(i32_thaw);
- DECREF(f64_thaw);
- DECREF(f32_thaw);
- DECREF(i64);
- DECREF(i32);
- DECREF(f64);
- DECREF(f32);
-}
-
void
TestNum_run_tests() {
- TestBatch *batch = TestBatch_new(58);
+ TestBatch *batch = TestBatch_new(53);
TestBatch_Plan(batch);
test_To_String(batch);
@@ -309,7 +276,6 @@ TestNum_run_tests() {
test_Equals_and_Compare_To(batch);
test_Clone(batch);
test_Mimic(batch);
- test_serialization(batch);
DECREF(batch);
}
Modified: lucy/trunk/clownfish/runtime/core/Clownfish/Test/TestVArray.c
URL: http://svn.apache.org/viewvc/lucy/trunk/clownfish/runtime/core/Clownfish/Test/TestVArray.c?rev=1393674&r1=1393673&r2=1393674&view=diff
==============================================================================
--- lucy/trunk/clownfish/runtime/core/Clownfish/Test/TestVArray.c (original)
+++ lucy/trunk/clownfish/runtime/core/Clownfish/Test/TestVArray.c Wed Oct 3 18:58:47 2012
@@ -308,22 +308,9 @@ test_Dump_and_Load(TestBatch *batch) {
DECREF(loaded);
}
-static void
-test_serialization(TestBatch *batch) {
- VArray *array = VA_new(0);
- VArray *dupe;
- VA_Store(array, 1, (Obj*)CB_newf("foo"));
- VA_Store(array, 3, (Obj*)CB_newf("bar"));
- dupe = (VArray*)TestUtils_freeze_thaw((Obj*)array);
- TEST_TRUE(batch, dupe && VA_Equals(array, (Obj*)dupe),
- "Round trip through FREEZE/THAW");
- DECREF(dupe);
- DECREF(array);
-}
-
void
TestVArray_run_tests() {
- TestBatch *batch = TestBatch_new(45);
+ TestBatch *batch = TestBatch_new(44);
TestBatch_Plan(batch);
@@ -337,7 +324,6 @@ TestVArray_run_tests() {
test_Slice(batch);
test_Clone_and_Shallow_Copy(batch);
test_Dump_and_Load(batch);
- test_serialization(batch);
DECREF(batch);
}