test/dlist_tests.c

changeset 89
47f7fdbddb62
parent 71
303dabadff1c
child 90
ef3163857e88
     1.1 --- a/test/dlist_tests.c	Wed Feb 27 09:41:17 2013 +0100
     1.2 +++ b/test/dlist_tests.c	Wed Feb 27 10:09:23 2013 +0100
     1.3 @@ -3,6 +3,7 @@
     1.4   */
     1.5  
     1.6  #include "dlist_tests.h"
     1.7 +#include "ucx/comparator.h"
     1.8  
     1.9  UCX_TEST_IMPLEMENT(test_ucx_dlist_append) {
    1.10      UcxDlist *list = ucx_dlist_append(NULL, (void*)"Hello");
    1.11 @@ -46,8 +47,8 @@
    1.12      list3 = ucx_dlist_prepend(list3, (void*)"Hallo");
    1.13      UCX_TEST_BEGIN
    1.14      
    1.15 -    UCX_TEST_ASSERT(ucx_dlist_equals(list, list2, cmp_string, NULL), "failed");
    1.16 -    UCX_TEST_ASSERT(!ucx_dlist_equals(list, list3, cmp_string, NULL), "failed");
    1.17 +    UCX_TEST_ASSERT(ucx_dlist_equals(list, list2, ucx_strcmp, NULL), "failed");
    1.18 +    UCX_TEST_ASSERT(!ucx_dlist_equals(list, list3, ucx_strcmp, NULL), "failed");
    1.19      
    1.20      UCX_TEST_END
    1.21      ucx_dlist_free(list3);
    1.22 @@ -160,7 +161,7 @@
    1.23      UcxDlist *copy = ucx_dlist_clone(list, copy_string, NULL);
    1.24      UCX_TEST_BEGIN
    1.25  
    1.26 -    UCX_TEST_ASSERT(ucx_dlist_equals(list, copy, cmp_string, NULL), "failed");
    1.27 +    UCX_TEST_ASSERT(ucx_dlist_equals(list, copy, ucx_strcmp, NULL), "failed");
    1.28      UCX_TEST_ASSERT(hello != copy->data, "first element is no copy");
    1.29      UCX_TEST_ASSERT(world != copy->next->data, "second element is no copy");
    1.30  
    1.31 @@ -191,11 +192,11 @@
    1.32      expected = ucx_dlist_append(expected, (void*)"test");
    1.33      expected = ucx_dlist_append(expected, (void*)"this");
    1.34  
    1.35 -    list = ucx_dlist_sort(list, cmp_string, NULL);
    1.36 +    list = ucx_dlist_sort(list, ucx_strcmp, NULL);
    1.37  
    1.38      UCX_TEST_BEGIN
    1.39      UCX_TEST_ASSERT(
    1.40 -            ucx_dlist_equals(list, expected, cmp_string, NULL), "failed");
    1.41 +            ucx_dlist_equals(list, expected, ucx_strcmp, NULL), "failed");
    1.42      UcxDlist *l = list;
    1.43      UCX_TEST_ASSERT(l->prev == NULL, "prev field of first entry is not null");
    1.44      while (l->next != NULL) {

mercurial