--- a/tests/test_tree.c Tue Nov 26 22:00:03 2024 +0100 +++ b/tests/test_tree.c Tue Nov 26 22:16:27 2024 +0100 @@ -1772,7 +1772,7 @@ CX_TEST_ASSERT(!cx_testing_allocator_verify(&talloc)); CX_TEST_ASSERT(talloc.alloc_total == 1); - cxTreeDestroy(tree); + cxTreeFree(tree); CX_TEST_ASSERT(cx_testing_allocator_verify(&talloc)); } cx_testing_allocator_destroy(&talloc); @@ -1801,7 +1801,7 @@ CX_TEST_ASSERT(tree->loc_last_child == offsetof(struct cx_tree_node_base_s, last_child)); CX_TEST_ASSERT(tree->loc_prev == offsetof(struct cx_tree_node_base_s, prev)); CX_TEST_ASSERT(tree->loc_next == offsetof(struct cx_tree_node_base_s, next)); - cxTreeDestroy(tree); + cxTreeFree(tree); } } @@ -1827,7 +1827,7 @@ CX_TEST_ASSERT(tree->loc_last_child == -1); CX_TEST_ASSERT(tree->loc_prev == offsetof(tree_node, prev)); CX_TEST_ASSERT(tree->loc_next == offsetof(tree_node, next)); - cxTreeDestroy(tree); + cxTreeFree(tree); } } @@ -1852,9 +1852,9 @@ tree_node_file_layout ); CX_TEST_ASSERT(cxTreeDepth(empty) == 0); - cxTreeDestroy(empty); + cxTreeFree(empty); } - cxTreeDestroy(tree); + cxTreeFree(tree); } CX_TEST(test_tree_high_set_parent) { @@ -1884,9 +1884,9 @@ tree_node_file_layout ); CX_TEST_ASSERT(cxTreeDepth(empty) == 0); - cxTreeDestroy(empty); + cxTreeFree(empty); } - cxTreeDestroy(tree); + cxTreeFree(tree); } CX_TEST(test_tree_high_insert_one) { @@ -1916,7 +1916,7 @@ CX_TEST_ASSERT(talloc.alloc_total == 8); CX_TEST_ASSERT(talloc.free_total == 1); // the one that could not be added - cxTreeDestroy(tree); + cxTreeFree(tree); CX_TEST_ASSERT(cx_testing_allocator_verify(&talloc)); } cx_testing_allocator_destroy(&talloc); @@ -1949,7 +1949,7 @@ CX_TEST_ASSERT(talloc.alloc_total == 8); CX_TEST_ASSERT(talloc.free_total == 1); // the one that could not be added - cxTreeDestroy(tree); + cxTreeFree(tree); CX_TEST_ASSERT(cx_testing_allocator_verify(&talloc)); } cx_testing_allocator_destroy(&talloc); @@ -2044,7 +2044,7 @@ CX_TEST_ASSERT(NULL != cxTreeFind(tree, "/home/")); - cxTreeDestroy(tree); + cxTreeFree(tree); // we are not done yet, because we need to free the removed stuff CX_TEST_ASSERT(!cx_testing_allocator_verify(&talloc)); @@ -2054,7 +2054,7 @@ foo_tree->allocator = alloc; foo_tree->advanced_destructor = (cx_destructor_func2 ) cxFree; foo_tree->destructor_data = alloc; - cxTreeDestroy(foo_tree); + cxTreeFree(foo_tree); CX_TEST_ASSERT(cx_testing_allocator_verify(&talloc)); } cx_testing_allocator_destroy(&talloc); @@ -2129,7 +2129,7 @@ CX_TEST_ASSERT(relinked_lib->parent == tree->root); CX_TEST_ASSERT(NULL != cxTreeFind(tree, "/home/")); - cxTreeDestroy(tree); + cxTreeFree(tree); // all memory should be free when using destroy instead of remove CX_TEST_ASSERT(cx_testing_allocator_verify(&talloc)); } @@ -2168,14 +2168,14 @@ CX_TEST_ASSERT(tree->size == 0); CX_TEST_ASSERT(tree->root == NULL); CX_TEST_ASSERT(cxTreeDepth(tree) == 0); - cxTreeDestroy(tree); + cxTreeFree(tree); CX_TEST_ASSERT(!cx_testing_allocator_verify(&talloc)); CxTree *w = cxTreeCreateWrapped(alloc, root, tree_node_file_layout); w->advanced_destructor = (cx_destructor_func2) cxFree; w->destructor_data = alloc; cxTreeDestroySubtree(w, w->root); CX_TEST_ASSERT(!cx_testing_allocator_verify(&talloc)); - cxTreeDestroy(w); + cxTreeFree(w); CX_TEST_ASSERT(cx_testing_allocator_verify(&talloc)); } cx_testing_allocator_destroy(&talloc); @@ -2194,7 +2194,7 @@ CxTree *tree = cxTreeCreateWrapped(cxDefaultAllocator, &root, tree_node_layout); tree->simple_destructor = test_tree_high_simple_destructor_func; cxTreeDestroyNode(tree, &child1, NULL); - cxTreeDestroy(tree); + cxTreeFree(tree); CX_TEST_ASSERT(root.data == 1); CX_TEST_ASSERT(child1.data == 1); CX_TEST_ASSERT(child2.data == 1);