#define DEBUG_SYMBOL_TREE
-class test_symbol_tree : public virtual unit_base, virtual public application_shell
+// how many nodes we add to the tree.
+const int MAX_NODES_TESTED = 40000;
+
+class test_symbol_tree : public unit_base, public application_shell
{
public:
- test_symbol_tree() {}
+ test_symbol_tree() : unit_base() {}
DEFINE_CLASS_NAME("test_symbol_tree");
int execute();
};
int test_symbol_tree::execute()
{
+ FUNCDEF("execute");
LOG("please check memory usage and record it, then hit a key to start testing.");
try {
+ // creates a crazy tree with only one branch per node, but 40,000 deep.
symbol_tree t("blork");
symbol_tree *curr = &t;
- for (int i = 0; i < 40000; i++) {
+ 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.
if (curr->branches()) {
LOG("check memory usage after the run. then hit a key to end "
"the program.");
-//create a tree structure...
+//create a more balanced tree structure...
//perform known operations and validate shape of tree.
return final_report();