projects
/
feisty_meow.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added in gaming as a category
[feisty_meow.git]
/
nucleus
/
library
/
tests_nodes
/
test_symbol_tree.cpp
diff --git
a/nucleus/library/tests_nodes/test_symbol_tree.cpp
b/nucleus/library/tests_nodes/test_symbol_tree.cpp
index 5ba5bd5fa374cb15263376d353f16449a7ab8d7a..64e917e04c538861207e1bac908a670dce240ec8 100644
(file)
--- a/
nucleus/library/tests_nodes/test_symbol_tree.cpp
+++ b/
nucleus/library/tests_nodes/test_symbol_tree.cpp
@@
-41,12
+41,10
@@
using namespace unit_test;
#define LOG(to_print) EMERGENCY_LOG(program_wide_logger().get(), astring(to_print))
#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.
// how many nodes we add to the tree.
-//const int MAX_NODES_TESTED = 40000;
-//hmmm: TEMPORARY!!!
-const int MAX_NODES_TESTED = 2;
+const int MAX_NODES_TESTED = 40000;
class test_symbol_tree : public unit_base, public application_shell
{
class test_symbol_tree : public unit_base, public application_shell
{
@@
-75,15
+73,26
@@
int test_symbol_tree::execute()
astring rando = string_manipulation::make_random_name(1, 10);
curr->add(new symbol_tree(rando));
}
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);
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 (...) {
} catch (...) {
+#ifdef DEBUG_TEST_SYMBOL_TREE
LOG("crashed during tree stuffing.");
LOG("crashed during tree stuffing.");
+#endif
return 1;
}
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();
// perform known operations and validate shape of tree.
return final_report();