From 07a1f9d6b547b70ca74120ef238e96c3c8d5439a Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Tue, 6 May 2014 21:17:09 -0400 Subject: [PATCH] Unit Tests - Added tests for Tree::countTags. --- test/tree.t.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/tree.t.cpp b/test/tree.t.cpp index 6d0eb5845..4ed2f05e3 100644 --- a/test/tree.t.cpp +++ b/test/tree.t.cpp @@ -33,10 +33,11 @@ Context context; //////////////////////////////////////////////////////////////////////////////// int main (int argc, char** argv) { - UnitTest ut (8); + UnitTest ut (10); // Construct tree as shown above. Tree t ("root"); + ut.is (t.countTags (), 0, "countTags == 0"); Tree* b = t.addBranch (new Tree ("c1")); b->attribute ("name", "c1"); @@ -59,6 +60,7 @@ int main (int argc, char** argv) t._branches[2]->_branches[0]->tag ("one"); t._branches[2]->_branches[0]->tag ("two"); + ut.is (t._branches[2]->_branches[0]->countTags (), 2, "countTags == 2"); ut.ok (t._branches[2]->_branches[0]->hasTag ("one"), "hasTag +"); ut.notok (t._branches[2]->_branches[0]->hasTag ("three"), "hasTag -");