test/dlist_tests.c

changeset 69
fb59270b1de3
parent 40
583718dd4cf3
child 71
303dabadff1c
     1.1 --- a/test/dlist_tests.c	Thu Oct 11 16:29:30 2012 +0200
     1.2 +++ b/test/dlist_tests.c	Fri Oct 12 10:54:55 2012 +0200
     1.3 @@ -8,11 +8,13 @@
     1.4      UcxDlist *list = ucx_dlist_append(NULL, "Hello");
     1.5      UCX_TEST_BEGIN
     1.6      
     1.7 -    UCX_TEST_ASSERT(strncmp(list->data, "Hello", 5) == 0, "failed");
     1.8 +    UCX_TEST_ASSERT(strncmp((const char*)list->data, "Hello", 5) == 0,
     1.9 +            "failed");
    1.10      
    1.11      list = ucx_dlist_append(list, " World!");
    1.12      
    1.13 -    UCX_TEST_ASSERT(strncmp(list->next->data, " World!", 7) == 0, "failed");
    1.14 +    UCX_TEST_ASSERT(strncmp((const char*)list->next->data, " World!", 7) == 0,
    1.15 +            "failed");
    1.16      UCX_TEST_ASSERT(list->next->next == NULL, "failed");
    1.17      UCX_TEST_END
    1.18      
    1.19 @@ -25,8 +27,10 @@
    1.20  
    1.21      list = ucx_dlist_prepend(list, "Hello");
    1.22      
    1.23 -    UCX_TEST_ASSERT(strncmp(list->data, "Hello", 5) == 0, "failed");
    1.24 -    UCX_TEST_ASSERT(strncmp(list->next->data, " World!", 7) == 0, "failed");
    1.25 +    UCX_TEST_ASSERT(strncmp((const char*)list->data, "Hello", 5) == 0,
    1.26 +            "failed");
    1.27 +    UCX_TEST_ASSERT(strncmp((const char*)list->next->data, " World!", 7) == 0,
    1.28 +            "failed");
    1.29      UCX_TEST_ASSERT(list->next->next == NULL, "failed");
    1.30      
    1.31      UCX_TEST_END
    1.32 @@ -58,8 +62,10 @@
    1.33      
    1.34      list = ucx_dlist_concat(list, list2);
    1.35      
    1.36 -    UCX_TEST_ASSERT(strncmp(list->data, "Hello", 5) == 0, "failed");
    1.37 -    UCX_TEST_ASSERT(strncmp(list->next->data, " World!", 7) == 0, "failed");
    1.38 +    UCX_TEST_ASSERT(strncmp((const char*)list->data, "Hello", 5) == 0,
    1.39 +            "failed");
    1.40 +    UCX_TEST_ASSERT(strncmp((const char*)list->next->data, " World!", 7) == 0,
    1.41 +            "failed");
    1.42      UCX_TEST_ASSERT(list->next->next == NULL, "failed");
    1.43      
    1.44      UCX_TEST_END
    1.45 @@ -86,7 +92,7 @@
    1.46      list = ucx_dlist_append(list, "the ");
    1.47      list = ucx_dlist_append(list, "first!");
    1.48      
    1.49 -    char* first = (char*) (ucx_dlist_first(list)->data);
    1.50 +    const char* first = (const char*) (ucx_dlist_first(list)->data);
    1.51      
    1.52      UCX_TEST_ASSERT(strncmp(first, "Find ", 5) == 0, "failed");
    1.53      
    1.54 @@ -100,7 +106,7 @@
    1.55      list = ucx_dlist_append(list, "the ");
    1.56      list = ucx_dlist_append(list, "last!");
    1.57      
    1.58 -    char* last = (char*) (ucx_dlist_last(list)->data);
    1.59 +    const char* last = (const char*) (ucx_dlist_last(list)->data);
    1.60      
    1.61      UCX_TEST_ASSERT(strncmp(last, "last!", 5) == 0, "failed");
    1.62      
    1.63 @@ -114,7 +120,7 @@
    1.64      list = ucx_dlist_append(list, "the ");
    1.65      list = ucx_dlist_append(list, "mid!");
    1.66      
    1.67 -    char* mid = (char*) (ucx_dlist_get(list, 1)->data);
    1.68 +    const char* mid = (const char*) (ucx_dlist_get(list, 1)->data);
    1.69      
    1.70      UCX_TEST_ASSERT(strncmp(mid, "the ", 4) == 0, "failed");
    1.71      
    1.72 @@ -130,8 +136,10 @@
    1.73      
    1.74      list = ucx_dlist_remove(list, ucx_dlist_get(list, 1));
    1.75      
    1.76 -    UCX_TEST_ASSERT(strncmp(list->data, "Hello", 5) == 0, "failed");
    1.77 -    UCX_TEST_ASSERT(strncmp(list->next->data, " World!", 7) == 0, "failed");
    1.78 +    UCX_TEST_ASSERT(strncmp((const char*)list->data, "Hello", 5) == 0,
    1.79 +            "failed");
    1.80 +    UCX_TEST_ASSERT(strncmp((const char*)list->next->data, " World!", 7) == 0,
    1.81 +            "failed");
    1.82      UCX_TEST_ASSERT(list->next->next == NULL, "failed");
    1.83      
    1.84      UCX_TEST_END

mercurial