X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=nucleus%2Flibrary%2Ftests_nodes%2Ftest_symbol_tree.cpp;h=64e917e04c538861207e1bac908a670dce240ec8;hb=95bc523256ac9a11c4a1d0797662d8e3190da9ce;hp=fa4a5c8cb40c198b7db12eb60b45a14a365629d8;hpb=dfeba549161a42f001a6b8ec78c7e61911c1c3e5;p=feisty_meow.git diff --git a/nucleus/library/tests_nodes/test_symbol_tree.cpp b/nucleus/library/tests_nodes/test_symbol_tree.cpp index fa4a5c8c..64e917e0 100644 --- a/nucleus/library/tests_nodes/test_symbol_tree.cpp +++ b/nucleus/library/tests_nodes/test_symbol_tree.cpp @@ -41,7 +41,7 @@ using namespace unit_test; #define LOG(to_print) EMERGENCY_LOG(program_wide_logger().get(), astring(to_print)) -#define DEBUG_SYMBOL_TREE +//#define DEBUG_TEST_SYMBOL_TREE // how many nodes we add to the tree. const int MAX_NODES_TESTED = 40000; @@ -73,15 +73,26 @@ int test_symbol_tree::execute() astring rando = string_manipulation::make_random_name(1, 10); curr->add(new symbol_tree(rando)); } -LOG("about to whack dynamic tree..."); +#ifdef DEBUG_TEST_SYMBOL_TREE + LOG("about to whack dynamic tree..."); +#endif WHACK(t); -LOG("dynamic tree whacked."); + ASSERT_EQUAL(t, NULL_POINTER, "ensure pointer cleaned up"); +#ifdef DEBUG_TEST_SYMBOL_TREE + LOG("dynamic tree whacked."); +#endif } catch (...) { +#ifdef DEBUG_TEST_SYMBOL_TREE LOG("crashed during tree stuffing."); +#endif return 1; } -//hmmm: create a more balanced tree structure... + ASSERT_TRUE(true, "testing succeeded without cleanup crashes"); + + + +//hmmm: need more tests, like where we create a more balanced tree structure... // perform known operations and validate shape of tree. return final_report();