X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=nucleus%2Flibrary%2Ftests_nodes%2Ftest_symbol_tree.cpp;h=5ba5bd5fa374cb15263376d353f16449a7ab8d7a;hb=84fc634d86157509079210d5b103deaa2122f9b7;hp=8d4b2a151cc29e7dc28980fe8d36463de0a2d258;hpb=5a8e13e7a44ed98d9683bc6cd3bb374e9d3b0756;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 8d4b2a15..5ba5bd5f 100644 --- a/nucleus/library/tests_nodes/test_symbol_tree.cpp +++ b/nucleus/library/tests_nodes/test_symbol_tree.cpp @@ -28,9 +28,6 @@ #include #include -//#include -//#include - using namespace application; using namespace basis; using namespace filesystem; @@ -47,7 +44,9 @@ using namespace unit_test; #define DEBUG_SYMBOL_TREE // how many nodes we add to the tree. -const int MAX_NODES_TESTED = 40000; +//const int MAX_NODES_TESTED = 40000; +//hmmm: TEMPORARY!!! +const int MAX_NODES_TESTED = 2; class test_symbol_tree : public unit_base, public application_shell { @@ -60,11 +59,11 @@ public: int test_symbol_tree::execute() { FUNCDEF("execute"); - LOG("please check memory usage and record it, then hit a key to start testing."); try { - symbol_tree t("blork"); - symbol_tree *curr = &t; + // creates a crazy tree with only one branch per node, but hugely deep. + symbol_tree *t = new symbol_tree("blork"); + symbol_tree *curr = t; for (int i = 0; i < MAX_NODES_TESTED; i++) { // if the current node has any branches, we'll jump on one as the next // place. @@ -76,24 +75,16 @@ int test_symbol_tree::execute() astring rando = string_manipulation::make_random_name(1, 10); curr->add(new symbol_tree(rando)); } - LOG("check memory usage now with full size. then hit a key."); +LOG("about to whack dynamic tree..."); + WHACK(t); +LOG("dynamic tree whacked."); } catch (...) { LOG("crashed during tree stuffing."); return 1; } -LOG("got out of the loop"); - -//one assertion to tickle final report. - bool farp = true; - ASSERT_TRUE(farp, "tickling reporting for assertions"); -//hmmm: above shouldn't be needed at all. - - LOG("check memory usage after the run. then hit a key to end " - "the program."); - -//create a tree structure... -//perform known operations and validate shape of tree. +//hmmm: create a more balanced tree structure... +// perform known operations and validate shape of tree. return final_report(); }