test/test_list.c

changeset 444
cb944fa1852a
parent 443
d6d8712e15bc
child 446
668757098b73
equal deleted inserted replaced
443:d6d8712e15bc 444:cb944fa1852a
98 98
99 CU_ASSERT_PTR_EQUAL(&a, cx_linked_list_at(&d, 3, loc_prev, 0)); 99 CU_ASSERT_PTR_EQUAL(&a, cx_linked_list_at(&d, 3, loc_prev, 0));
100 CU_ASSERT_PTR_EQUAL(&b, cx_linked_list_at(&d, 3, loc_prev, 1)); 100 CU_ASSERT_PTR_EQUAL(&b, cx_linked_list_at(&d, 3, loc_prev, 1));
101 } 101 }
102 102
103 void test_cx_linked_list_add(void) { 103 void test_linked_list_add(void) {
104 struct node { 104 struct node {
105 void *prev; 105 void *prev;
106 void *next; 106 void *next;
107 int value; 107 int value;
108 }; 108 };
174 174
175 suite = CU_add_suite("linked list suite", NULL, NULL); 175 suite = CU_add_suite("linked list suite", NULL, NULL);
176 176
177 CU_add_test(suite, "linked list: create and destroy", test_linked_list_create); 177 CU_add_test(suite, "linked list: create and destroy", test_linked_list_create);
178 CU_add_test(suite, "linked list: get node at index", test_linked_list_at); 178 CU_add_test(suite, "linked list: get node at index", test_linked_list_at);
179 CU_add_test(suite, "linked list: add", test_cx_linked_list_add); 179 CU_add_test(suite, "linked list: add", test_linked_list_add);
180 180
181 CU_basic_set_mode(UCX_CU_BRM); 181 CU_basic_set_mode(UCX_CU_BRM);
182 182
183 int exitcode; 183 int exitcode;
184 if (CU_basic_run_tests()) { 184 if (CU_basic_run_tests()) {

mercurial