test/list_tests.c

changeset 89
47f7fdbddb62
parent 71
303dabadff1c
child 90
ef3163857e88
     1.1 --- a/test/list_tests.c	Wed Feb 27 09:41:17 2013 +0100
     1.2 +++ b/test/list_tests.c	Wed Feb 27 10:09:23 2013 +0100
     1.3 @@ -3,6 +3,7 @@
     1.4   */
     1.5  
     1.6  #include "list_tests.h"
     1.7 +#include "ucx/comparator.h"
     1.8  
     1.9  UCX_TEST_IMPLEMENT(test_ucx_list_append) {
    1.10      UcxList *list = ucx_list_append(NULL, (void*)"Hello");
    1.11 @@ -44,8 +45,8 @@
    1.12      list3 = ucx_list_prepend(list3, (void*)"Hallo");
    1.13      
    1.14      UCX_TEST_BEGIN
    1.15 -    UCX_TEST_ASSERT(ucx_list_equals(list, list2, cmp_string, NULL), "failed");
    1.16 -    UCX_TEST_ASSERT(!ucx_list_equals(list, list3, cmp_string, NULL), "failed");
    1.17 +    UCX_TEST_ASSERT(ucx_list_equals(list, list2, ucx_strcmp, NULL), "failed");
    1.18 +    UCX_TEST_ASSERT(!ucx_list_equals(list, list3, ucx_strcmp, NULL), "failed");
    1.19      UCX_TEST_END
    1.20      
    1.21      ucx_list_free(list3);
    1.22 @@ -148,7 +149,7 @@
    1.23      UcxList *copy = ucx_list_clone(list, copy_string, NULL);
    1.24      UCX_TEST_BEGIN
    1.25  
    1.26 -    UCX_TEST_ASSERT(ucx_list_equals(list, copy, cmp_string, NULL), "failed");
    1.27 +    UCX_TEST_ASSERT(ucx_list_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 @@ -179,11 +180,11 @@
    1.32      expected = ucx_list_append(expected, (void*)"test");
    1.33      expected = ucx_list_append(expected, (void*)"this");
    1.34  
    1.35 -    list = ucx_list_sort(list, cmp_string, NULL);
    1.36 +    list = ucx_list_sort(list, ucx_strcmp, NULL);
    1.37  
    1.38      UCX_TEST_BEGIN
    1.39      UCX_TEST_ASSERT(
    1.40 -            ucx_list_equals(list, expected, cmp_string, NULL), "failed");
    1.41 +            ucx_list_equals(list, expected, ucx_strcmp, NULL), "failed");
    1.42      UCX_TEST_END
    1.43  
    1.44      ucx_list_free(expected);

mercurial