test/list_tests.c

changeset 90
ef3163857e88
parent 89
47f7fdbddb62
child 94
57ea041df22f
--- a/test/list_tests.c	Wed Feb 27 10:09:23 2013 +0100
+++ b/test/list_tests.c	Wed Feb 27 10:28:02 2013 +0100
@@ -117,6 +117,19 @@
     ucx_list_free(list);
 }
 
+UCX_TEST_IMPLEMENT(test_ucx_list_contains) {
+    UcxList *l = ucx_list_append(NULL, (void*)"Contains ");
+    UCX_TEST_BEGIN
+    l = ucx_list_append(l, (void*)"a ");
+    l = ucx_list_append(l, (void*)"string!");
+    
+    UCX_TEST_ASSERT(ucx_list_contains(l,(void*)"a ",ucx_strcmp,NULL), "failed");
+    UCX_TEST_ASSERT(!ucx_list_contains(l,(void*)"a",ucx_strcmp,NULL), "failed");
+    
+    UCX_TEST_END
+    ucx_list_free(l);
+}
+
 UCX_TEST_IMPLEMENT(test_ucx_list_remove) {
     UcxList *list = ucx_list_append(NULL, (void*)"Hello");
     UCX_TEST_BEGIN

mercurial