test/list_tests.c

changeset 90
ef3163857e88
parent 89
47f7fdbddb62
child 94
57ea041df22f
     1.1 --- a/test/list_tests.c	Wed Feb 27 10:09:23 2013 +0100
     1.2 +++ b/test/list_tests.c	Wed Feb 27 10:28:02 2013 +0100
     1.3 @@ -117,6 +117,19 @@
     1.4      ucx_list_free(list);
     1.5  }
     1.6  
     1.7 +UCX_TEST_IMPLEMENT(test_ucx_list_contains) {
     1.8 +    UcxList *l = ucx_list_append(NULL, (void*)"Contains ");
     1.9 +    UCX_TEST_BEGIN
    1.10 +    l = ucx_list_append(l, (void*)"a ");
    1.11 +    l = ucx_list_append(l, (void*)"string!");
    1.12 +    
    1.13 +    UCX_TEST_ASSERT(ucx_list_contains(l,(void*)"a ",ucx_strcmp,NULL), "failed");
    1.14 +    UCX_TEST_ASSERT(!ucx_list_contains(l,(void*)"a",ucx_strcmp,NULL), "failed");
    1.15 +    
    1.16 +    UCX_TEST_END
    1.17 +    ucx_list_free(l);
    1.18 +}
    1.19 +
    1.20  UCX_TEST_IMPLEMENT(test_ucx_list_remove) {
    1.21      UcxList *list = ucx_list_append(NULL, (void*)"Hello");
    1.22      UCX_TEST_BEGIN

mercurial