test/dlist_tests.c

changeset 90
ef3163857e88
parent 89
47f7fdbddb62
child 94
57ea041df22f
equal deleted inserted replaced
89:47f7fdbddb62 90:ef3163857e88
125 125
126 UCX_TEST_ASSERT(strncmp(mid, "the ", 4) == 0, "failed"); 126 UCX_TEST_ASSERT(strncmp(mid, "the ", 4) == 0, "failed");
127 127
128 UCX_TEST_END 128 UCX_TEST_END
129 ucx_dlist_free(list); 129 ucx_dlist_free(list);
130 }
131
132 UCX_TEST_IMPLEMENT(test_ucx_dlist_contains) {
133 UcxDlist *l = ucx_dlist_append(NULL, (void*)"Contains ");
134 UCX_TEST_BEGIN
135 l = ucx_dlist_append(l, (void*)"a ");
136 l = ucx_dlist_append(l, (void*)"string!");
137
138 UCX_TEST_ASSERT(ucx_dlist_contains(l,(void*)"a ",ucx_strcmp,NULL),"failed");
139 UCX_TEST_ASSERT(!ucx_dlist_contains(l,(void*)"a",ucx_strcmp,NULL),"failed");
140
141 UCX_TEST_END
142 ucx_dlist_free(l);
130 } 143 }
131 144
132 UCX_TEST_IMPLEMENT(test_ucx_dlist_remove) { 145 UCX_TEST_IMPLEMENT(test_ucx_dlist_remove) {
133 UcxDlist *list = ucx_dlist_append(NULL, (void*)"Hello"); 146 UcxDlist *list = ucx_dlist_append(NULL, (void*)"Hello");
134 UCX_TEST_BEGIN 147 UCX_TEST_BEGIN

mercurial