diff options
Diffstat (limited to 'src/tasktree.cc')
-rw-r--r-- | src/tasktree.cc | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/src/tasktree.cc b/src/tasktree.cc index 0a9ad46..c66e665 100644 --- a/src/tasktree.cc +++ b/src/tasktree.cc @@ -267,27 +267,42 @@ void TaskTree::toStdOut() { #ifdef TEST_TASKTREE //Additional dependency files -//deps: +//deps: debug.cc log.cc //Required cflags (autoconf vars may be used) -//cflags: +//cflags: -I.. //Required link options (autoconf vars may be used) //libs: #include "test.h" #include <exception> +#define ROOT_ID 0 +#define LOSTFOUND_ID 1 +#define FINISHED_ID 2 +#define BACKLOG_ID 3 +#define PROJECTS_ID 4 +#define FIRST_TASK_ID 10 + TEST_BEGIN; TaskTree tree; task_t t; -try { - tree.insertAsChild(-1, t); - } - catch(std::exeception& e) { - } - -// TODO: Put some testcode here (see test.h for usable macros). -TEST_TRUE(false, "No tests yet!"); +t.title = "root"; +tree.insertAsChild(0, ROOT_ID, t); + +t.title = "Finished"; +tree.insertAsChild(ROOT_ID, FINISHED_ID, t); + +t.title = "Backlog"; +tree.insertAsChild(ROOT_ID, BACKLOG_ID, t); + +t.title = "Lost+Found"; +tree.insertAsChild(ROOT_ID, LOSTFOUND_ID, t); + +t.title = "Projects"; +tree.insertAsChild(ROOT_ID, PROJECTS_ID, t); + +TEST_EQUAL_INT(5, tree.bfs(0).size(), "Testing BFS function"); TEST_END; |