test/test_tree.c

changeset 455
8168e16cd1e9
parent 453
bb144d08cd44
equal deleted inserted replaced
454:4b3219fab71c 455:8168e16cd1e9
40 40
41 TestNode *children_begin; 41 TestNode *children_begin;
42 TestNode *children_end; 42 TestNode *children_end;
43 }; 43 };
44 44
45 void test_cx_tree_add_node(void) { 45 void test_tree_add_sibling(void) {
46 // prepare test tree 46 // prepare test tree
47 TestNode root; 47 TestNode root;
48 memset(&root, 0, sizeof(TestNode)); 48 memset(&root, 0, sizeof(TestNode));
49 49
50 TestNode a; 50 TestNode a;
71 CU_ASSERT_PTR_NULL(c.prev) 71 CU_ASSERT_PTR_NULL(c.prev)
72 CU_ASSERT_PTR_NULL(c.next) 72 CU_ASSERT_PTR_NULL(c.next)
73 CU_ASSERT_PTR_EQUAL(b.next, &c) 73 CU_ASSERT_PTR_EQUAL(b.next, &c)
74 } 74 }
75 75
76 void test_cx_tree_add_child_node(void) { 76 void test_tree_add_child(void) {
77 // prepare test tree 77 // prepare test tree
78 TestNode root; 78 TestNode root;
79 memset(&root, 0, sizeof(TestNode)); 79 memset(&root, 0, sizeof(TestNode));
80 80
81 TestNode a; 81 TestNode a;
151 return CU_get_error(); 151 return CU_get_error();
152 } 152 }
153 153
154 suite = CU_add_suite("tree suite", NULL, NULL); 154 suite = CU_add_suite("tree suite", NULL, NULL);
155 155
156 CU_add_test(suite, "ll add tree node", test_cx_tree_add_node); 156 cu_add_test(suite, test_tree_add_sibling);
157 CU_add_test(suite, "ll add tree child node", test_cx_tree_add_child_node); 157 cu_add_test(suite, test_tree_add_child);
158 158
159
160 CU_basic_set_mode(UCX_CU_BRM); 159 CU_basic_set_mode(UCX_CU_BRM);
161 160
162 int exitcode; 161 int exitcode;
163 if (CU_basic_run_tests()) { 162 if (CU_basic_run_tests()) {
164 exitcode = CU_get_error(); 163 exitcode = CU_get_error();

mercurial