From 5f95718e7ebe4dec017055500793b928d8946d8e Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Sat, 6 Jun 2020 20:42:17 +0200 Subject: Port existing (in-file embedded) unit-tests to new framework. --- src/nodetree.cc | 51 --------------------------------------------------- 1 file changed, 51 deletions(-) (limited to 'src/nodetree.cc') diff --git a/src/nodetree.cc b/src/nodetree.cc index 1c3992e..2043c90 100644 --- a/src/nodetree.cc +++ b/src/nodetree.cc @@ -422,54 +422,3 @@ void NodeTree::fromXML(std::string xml) XmlParser p(this); p.parse(xml.c_str(), xml.size()); } - - -#ifdef TEST_NODETREE -//Additional dependency files -//deps: debug.cc log.cc -//Required cflags (autoconf vars may be used) -//cflags: -I.. -//Required link options (autoconf vars may be used) -//libs: -#include "test.h" -#include - -#define ROOT_ID 0 -#define LOSTFOUND_ID 1 -#define FINISHED_ID 2 -#define BACKLOG_ID 3 -#define PROJECTS_ID 4 -#define FIRST_NODE_ID 10 - -TEST_BEGIN; - -NodeTree tree; - -node_t t; -t.attributes["title"] = "root"; -t.id = ROOT_ID; -tree.insertAsChild(0, ROOT_ID, t); - -t.attributes["title"] = "Finished"; -t.id = FINISHED_ID; -tree.insertAsChild(ROOT_ID, FINISHED_ID, t); - -t.attributes["title"] = "Backlog"; -t.id = BACKLOG_ID; -tree.insertAsChild(ROOT_ID, BACKLOG_ID, t); - -t.attributes["title"] = "Lost+Found"; -t.id = LOSTFOUND_ID; -tree.insertAsChild(ROOT_ID, LOSTFOUND_ID, t); - -t.attributes["title"] = "Projects"; -t.id = PROJECTS_ID; -tree.insertAsChild(ROOT_ID, PROJECTS_ID, t); - -TEST_EQUAL_INT(5, tree.bfs(0).size(), "Testing BFS function"); -TEST_EQUAL_INT(PROJECTS_ID, tree.data(PROJECTS_ID).id, "Testing project id"); -TEST_EQUAL_INT(ROOT_ID, tree.data(ROOT_ID).id, "Testing root id"); - -TEST_END; - -#endif/*TEST_NODETREE*/ -- cgit v1.2.3