test/map_tests.c

changeset 40
583718dd4cf3
parent 34
0dcd2ca2a223
child 41
7f90a03e186e
--- a/test/map_tests.c	Tue Oct 02 13:43:17 2012 +0200
+++ b/test/map_tests.c	Thu Oct 04 11:37:23 2012 +0200
@@ -7,8 +7,8 @@
 UCX_TEST_IMPLEMENT(test_ucx_map_new) {
     UcxMap *map = ucx_map_new(16);
     UCX_TEST_BEGIN
-    UCX_TEST_ASSERT(map->size == 16, "wrong size")
-    UCX_TEST_ASSERT(map->map != NULL, "failed")
+    UCX_TEST_ASSERT(map->size == 16, "wrong size");
+    UCX_TEST_ASSERT(map->map != NULL, "failed");
     
     UCX_TEST_END
     ucx_map_free(map);
@@ -17,9 +17,9 @@
 UCX_TEST_IMPLEMENT(test_ucx_key) {
     UcxKey key = ucx_key("This is a text.", 15);
     UCX_TEST_BEGIN
-    UCX_TEST_ASSERT(strncmp(key.data, "This is a text.", 15) == 0, "failed")
-    UCX_TEST_ASSERT(key.len == 15, "failed")
-    UCX_TEST_ASSERT(key.hash == 1261186027, "hash failed")
+    UCX_TEST_ASSERT(strncmp(key.data, "This is a text.", 15) == 0, "failed");
+    UCX_TEST_ASSERT(key.len == 15, "failed");
+    UCX_TEST_ASSERT(key.hash == 1261186027, "hash failed");
     
     UCX_TEST_END
 }
@@ -38,30 +38,30 @@
     ucx_map_cstr_put(map, "KeY3", &td[3]); /* 2 */
     ucx_map_cstr_put(map, "KEY4", &td[4]); /* 0 */
     
-    UCX_TEST_ASSERT(*((int*)map->map[0]->data) == td[0], "failed Key0")
-    UCX_TEST_ASSERT(map->map[0]->next != NULL, "no list at slot 0")
-    UCX_TEST_ASSERT(*((int*)map->map[0]->next->data) == td[2], "failed Key2")
-    UCX_TEST_ASSERT(map->map[0]->next->next != NULL, "list corrupt at slot 0")
+    UCX_TEST_ASSERT(*((int*)map->map[0]->data) == td[0], "failed Key0");
+    UCX_TEST_ASSERT(map->map[0]->next != NULL, "no list at slot 0");
+    UCX_TEST_ASSERT(*((int*)map->map[0]->next->data) == td[2], "failed Key2");
+    UCX_TEST_ASSERT(map->map[0]->next->next != NULL, "list corrupt at slot 0");
     UCX_TEST_ASSERT(*((int*)map->map[0]->next->next->data) == td[4],
             "failed Key4")
     UCX_TEST_ASSERT(map->map[0]->next->next->next == NULL,
             "slot 0 not terminated")
 
-    UCX_TEST_ASSERT(map->map[1] == NULL, "slot 1 not terminated")
+    UCX_TEST_ASSERT(map->map[1] == NULL, "slot 1 not terminated");
 
-    UCX_TEST_ASSERT(*((int*)map->map[2]->data) == td[3], "failed KeY3")
-    UCX_TEST_ASSERT(map->map[2]->next == NULL, "slot 2 not terminated")
+    UCX_TEST_ASSERT(*((int*)map->map[2]->data) == td[3], "failed KeY3");
+    UCX_TEST_ASSERT(map->map[2]->next == NULL, "slot 2 not terminated");
 
-    UCX_TEST_ASSERT(*((int*)map->map[3]->data) == td[1], "failed Key1")
+    UCX_TEST_ASSERT(*((int*)map->map[3]->data) == td[1], "failed Key1");
 
     ucx_map_cstr_put(map, "Key0", &td[3]); /* 0 */
     
-    UCX_TEST_ASSERT(*((int*)map->map[0]->data) == td[3], "overwrite failed")
+    UCX_TEST_ASSERT(*((int*)map->map[0]->data) == td[3], "overwrite failed");
     UCX_TEST_ASSERT(*((int*)map->map[0]->next->data) == td[2],
             "overwrite failed")
     UCX_TEST_ASSERT(*((int*)map->map[0]->next->next->data) == td[4], 
             "overwrite failed")
-    UCX_TEST_ASSERT(map->map[0]->next->next->next == NULL, "overwrite failed")
+    UCX_TEST_ASSERT(map->map[0]->next->next->next == NULL, "overwrite failed");
     
     UCX_TEST_END
     ucx_map_free(map);
@@ -85,11 +85,11 @@
     td[2] = *((int*)ucx_map_cstr_get(map, "Key2"));
     td[3] = *((int*)ucx_map_cstr_get(map, "KeY3"));
     td[4] = *((int*)ucx_map_cstr_get(map, "KEY4"));
-    UCX_TEST_ASSERT(td[0] == 10, "failed key 0")
-    UCX_TEST_ASSERT(td[1] == 42, "failed key 1")
-    UCX_TEST_ASSERT(td[2] == 70, "failed key 2")
-    UCX_TEST_ASSERT(td[3] == 11200, "failed key 3")
-    UCX_TEST_ASSERT(td[4] == 80000, "failed key 4")
+    UCX_TEST_ASSERT(td[0] == 10, "failed key 0");
+    UCX_TEST_ASSERT(td[1] == 42, "failed key 1");
+    UCX_TEST_ASSERT(td[2] == 70, "failed key 2");
+    UCX_TEST_ASSERT(td[3] == 11200, "failed key 3");
+    UCX_TEST_ASSERT(td[4] == 80000, "failed key 4");
 
     UCX_TEST_END
     ucx_map_free(map);

mercurial