tests/test_tree.c

changeset 1699
79c32b67c815
parent 1690
7d41291b3095
equal deleted inserted replaced
1698:1ba637f64695 1699:79c32b67c815
1436 CX_TEST_ASSERT(strcmp(root->path, "/") == 0); 1436 CX_TEST_ASSERT(strcmp(root->path, "/") == 0);
1437 1437
1438 cxTreeFree(tree); 1438 cxTreeFree(tree);
1439 CX_TEST_ASSERT(cx_testing_allocator_verify(&talloc)); 1439 CX_TEST_ASSERT(cx_testing_allocator_verify(&talloc));
1440 } 1440 }
1441 cx_testing_allocator_destroy(&talloc);
1441 } 1442 }
1442 1443
1443 CX_TEST(test_tree_high_set_root) { 1444 CX_TEST(test_tree_high_set_root) {
1444 CxTestingAllocator talloc; 1445 CxTestingAllocator talloc;
1445 cx_testing_allocator_init(&talloc); 1446 cx_testing_allocator_init(&talloc);
1471 1472
1472 // free the old root, check that memory is fine 1473 // free the old root, check that memory is fine
1473 cxFree(&talloc.base, old); 1474 cxFree(&talloc.base, old);
1474 CX_TEST_ASSERT(cx_testing_allocator_verify(&talloc)); 1475 CX_TEST_ASSERT(cx_testing_allocator_verify(&talloc));
1475 } 1476 }
1477 cx_testing_allocator_destroy(&talloc);
1476 } 1478 }
1477 1479
1478 CX_TEST(test_tree_high_tree_depth) { 1480 CX_TEST(test_tree_high_tree_depth) {
1479 tree_node root = {0}, child1 = {0}, child2 = {0}, child3 = {0}; 1481 tree_node root = {0}, child1 = {0}, child2 = {0}, child3 = {0};
1480 cx_tree_add(&root, &child1, tree_node_layout); 1482 cx_tree_add(&root, &child1, tree_node_layout);

mercurial