diff options
author | Jonas Suhr Christensen <jsc@umbraculum.org> | 2012-05-04 11:33:45 +0200 |
---|---|---|
committer | Jonas Suhr Christensen <jsc@umbraculum.org> | 2012-05-04 11:33:45 +0200 |
commit | c90f21d1d5526f87035fcf34ad40feb3348558c6 (patch) | |
tree | df72844e5e0e01bbe857ac1f7b0b03ff4d5f48dd | |
parent | 5df006d6a7c3b23864838b7b3b1f6b379ee103f3 (diff) |
Added test
-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; |