tests/test_tree.c

changeset 854
fe0d69d72bcd
parent 853
d4baf4dd55c3
child 862
387414a7afd8
equal deleted inserted replaced
853:d4baf4dd55c3 854:fe0d69d72bcd
258 CxTreeIterator iter = cx_tree_iterator(&root, false, tree_child_list); 258 CxTreeIterator iter = cx_tree_iterator(&root, false, tree_child_list);
259 CX_TEST_ASSERT(!iter.visit_on_exit); 259 CX_TEST_ASSERT(!iter.visit_on_exit);
260 CX_TEST_ASSERT(!iter.exiting); 260 CX_TEST_ASSERT(!iter.exiting);
261 CX_TEST_ASSERT(iter.counter == 1); 261 CX_TEST_ASSERT(iter.counter == 1);
262 CX_TEST_ASSERT(iter.node == &root); 262 CX_TEST_ASSERT(iter.node == &root);
263 CX_TEST_ASSERT(!iter.mutating); 263 CX_TEST_ASSERT(!iter.base.mutating);
264 CX_TEST_ASSERT(!iter.remove); 264 CX_TEST_ASSERT(!iter.base.remove);
265 CX_TEST_ASSERT(iter.stack != NULL); 265 CX_TEST_ASSERT(iter.stack != NULL);
266 CX_TEST_ASSERT(iter.stack_capacity > 0); 266 CX_TEST_ASSERT(iter.stack_capacity > 0);
267 CX_TEST_ASSERT(iter.stack_size == 1); 267 CX_TEST_ASSERT(iter.stack_size == 1);
268 CX_TEST_ASSERT(iter.depth == 1); 268 CX_TEST_ASSERT(iter.depth == 1);
269 CX_TEST_ASSERT(iter.loc_next == offsetof(tree_node, next)); 269 CX_TEST_ASSERT(iter.loc_next == offsetof(tree_node, next));
515 cx_tree_link(&root, &child, tree_node_layout); 515 cx_tree_link(&root, &child, tree_node_layout);
516 CX_TEST_DO { 516 CX_TEST_DO {
517 CxTreeVisitor iter = cx_tree_visitor(&root, tree_child_list); 517 CxTreeVisitor iter = cx_tree_visitor(&root, tree_child_list);
518 CX_TEST_ASSERT(iter.counter == 1); 518 CX_TEST_ASSERT(iter.counter == 1);
519 CX_TEST_ASSERT(iter.node == &root); 519 CX_TEST_ASSERT(iter.node == &root);
520 CX_TEST_ASSERT(!iter.mutating); 520 CX_TEST_ASSERT(!iter.base.mutating);
521 CX_TEST_ASSERT(!iter.remove); 521 CX_TEST_ASSERT(!iter.base.remove);
522 CX_TEST_ASSERT(iter.queue_next != NULL); 522 CX_TEST_ASSERT(iter.queue_next != NULL);
523 CX_TEST_ASSERT(iter.queue_last != NULL); 523 CX_TEST_ASSERT(iter.queue_last != NULL);
524 CX_TEST_ASSERT(iter.depth == 1); 524 CX_TEST_ASSERT(iter.depth == 1);
525 CX_TEST_ASSERT(iter.loc_next == offsetof(tree_node, next)); 525 CX_TEST_ASSERT(iter.loc_next == offsetof(tree_node, next));
526 CX_TEST_ASSERT(iter.loc_children == offsetof(tree_node, children)); 526 CX_TEST_ASSERT(iter.loc_children == offsetof(tree_node, children));

mercurial