char *test_traverse() { int rc = BSTree_traverse(map, traverse_good_cb); mu_assert(rc == 0, "Failed to traverse."); mu_assert(traverse_called == 3, "Wrong count on traverse."); traverse_called = 0; rc = BSTree_traverse(map, traverse_fail_cb); mu_assert(rc == 1, "Failed to traverse."); mu_assert(traverse_called == 2, "Wrong count traverse for fail."); return NULL; }
void BSTree_destroy(BSTree *map) { if (map) { BSTree_traverse(map, BSTree_destroy_cb, NULL); free(map); } }
void BSTree_destroy(BSTree* map) { if(map) { BSTree_traverse(map, BSTree_destroy_callback); free(map); } }