test for name and ccnx-wrapper
diff --git a/test/test-ccnx-name.cc b/test/test-ccnx-name.cc
index abab747..5084246 100644
--- a/test/test-ccnx-name.cc
+++ b/test/test-ccnx-name.cc
@@ -2,8 +2,6 @@
#include "ccnx-name.h"
#define BOOST_TEST_MAIN 1
-// #define BOOST_TEST_DYN_LINK
-// #define BOOST_TEST_Module Main
#include <boost/test/unit_test.hpp>
@@ -18,11 +16,27 @@
Name empty = Name();
Name root = Name("/");
BOOST_CHECK_EQUAL(empty, root);
+ BOOST_CHECK_EQUAL(empty, "/");
+ BOOST_CHECK_EQUAL(root.size(), 0);
+ empty.appendComp("hello");
+ empty.appendComp("world");
+ BOOST_CHECK_EQUAL(empty.size(), 2);
+ BOOST_CHECK_EQUAL(empty.toString(), "/hello/world");
+ empty = empty + root;
+ BOOST_CHECK_EQUAL(empty.toString(), "/hello/world");
+ BOOST_CHECK_EQUAL(empty.getCompAsString(0), "hello");
+ BOOST_CHECK_EQUAL(empty.getPartialName(1, 1), Name("/world"));
+ Name name("/hello/world");
+ BOOST_CHECK_EQUAL(empty, name);
+ BOOST_CHECK_EQUAL(name, Name("/hello") + Name("/world"));
+
+ // Charbuf related stuff will be checked in other place
}
BOOST_AUTO_TEST_CASE (SelectorsTest)
{
- int i = 0;
+ Selectors s;
+ BOOST_CHECK(s.isEmpty());
}
BOOST_AUTO_TEST_SUITE_END()