test/dlist_tests.c

changeset 69
fb59270b1de3
parent 40
583718dd4cf3
child 71
303dabadff1c
--- a/test/dlist_tests.c	Thu Oct 11 16:29:30 2012 +0200
+++ b/test/dlist_tests.c	Fri Oct 12 10:54:55 2012 +0200
@@ -8,11 +8,13 @@
     UcxDlist *list = ucx_dlist_append(NULL, "Hello");
     UCX_TEST_BEGIN
     
-    UCX_TEST_ASSERT(strncmp(list->data, "Hello", 5) == 0, "failed");
+    UCX_TEST_ASSERT(strncmp((const char*)list->data, "Hello", 5) == 0,
+            "failed");
     
     list = ucx_dlist_append(list, " World!");
     
-    UCX_TEST_ASSERT(strncmp(list->next->data, " World!", 7) == 0, "failed");
+    UCX_TEST_ASSERT(strncmp((const char*)list->next->data, " World!", 7) == 0,
+            "failed");
     UCX_TEST_ASSERT(list->next->next == NULL, "failed");
     UCX_TEST_END
     
@@ -25,8 +27,10 @@
 
     list = ucx_dlist_prepend(list, "Hello");
     
-    UCX_TEST_ASSERT(strncmp(list->data, "Hello", 5) == 0, "failed");
-    UCX_TEST_ASSERT(strncmp(list->next->data, " World!", 7) == 0, "failed");
+    UCX_TEST_ASSERT(strncmp((const char*)list->data, "Hello", 5) == 0,
+            "failed");
+    UCX_TEST_ASSERT(strncmp((const char*)list->next->data, " World!", 7) == 0,
+            "failed");
     UCX_TEST_ASSERT(list->next->next == NULL, "failed");
     
     UCX_TEST_END
@@ -58,8 +62,10 @@
     
     list = ucx_dlist_concat(list, list2);
     
-    UCX_TEST_ASSERT(strncmp(list->data, "Hello", 5) == 0, "failed");
-    UCX_TEST_ASSERT(strncmp(list->next->data, " World!", 7) == 0, "failed");
+    UCX_TEST_ASSERT(strncmp((const char*)list->data, "Hello", 5) == 0,
+            "failed");
+    UCX_TEST_ASSERT(strncmp((const char*)list->next->data, " World!", 7) == 0,
+            "failed");
     UCX_TEST_ASSERT(list->next->next == NULL, "failed");
     
     UCX_TEST_END
@@ -86,7 +92,7 @@
     list = ucx_dlist_append(list, "the ");
     list = ucx_dlist_append(list, "first!");
     
-    char* first = (char*) (ucx_dlist_first(list)->data);
+    const char* first = (const char*) (ucx_dlist_first(list)->data);
     
     UCX_TEST_ASSERT(strncmp(first, "Find ", 5) == 0, "failed");
     
@@ -100,7 +106,7 @@
     list = ucx_dlist_append(list, "the ");
     list = ucx_dlist_append(list, "last!");
     
-    char* last = (char*) (ucx_dlist_last(list)->data);
+    const char* last = (const char*) (ucx_dlist_last(list)->data);
     
     UCX_TEST_ASSERT(strncmp(last, "last!", 5) == 0, "failed");
     
@@ -114,7 +120,7 @@
     list = ucx_dlist_append(list, "the ");
     list = ucx_dlist_append(list, "mid!");
     
-    char* mid = (char*) (ucx_dlist_get(list, 1)->data);
+    const char* mid = (const char*) (ucx_dlist_get(list, 1)->data);
     
     UCX_TEST_ASSERT(strncmp(mid, "the ", 4) == 0, "failed");
     
@@ -130,8 +136,10 @@
     
     list = ucx_dlist_remove(list, ucx_dlist_get(list, 1));
     
-    UCX_TEST_ASSERT(strncmp(list->data, "Hello", 5) == 0, "failed");
-    UCX_TEST_ASSERT(strncmp(list->next->data, " World!", 7) == 0, "failed");
+    UCX_TEST_ASSERT(strncmp((const char*)list->data, "Hello", 5) == 0,
+            "failed");
+    UCX_TEST_ASSERT(strncmp((const char*)list->next->data, " World!", 7) == 0,
+            "failed");
     UCX_TEST_ASSERT(list->next->next == NULL, "failed");
     
     UCX_TEST_END

mercurial