build: Fixing build and unit tests
Use only C++ and boost methods (memory copying, comparison, time
operations), which are guaranteed to be present on all platforms
with C++ and boost libraries.
Change-Id: Ia2883555c55909a4f7a877cf6d5fbd49b12c73c8
diff --git a/tests/test-time.cpp b/tests/test-time.cpp
new file mode 100644
index 0000000..bc77fbd
--- /dev/null
+++ b/tests/test-time.cpp
@@ -0,0 +1,23 @@
+/**
+ * Copyright (C) 2013 Regents of the University of California.
+ * See COPYING for copyright and distribution information.
+ */
+
+#include <boost/test/unit_test.hpp>
+
+#include <../src/util/time.hpp>
+
+BOOST_AUTO_TEST_SUITE(TestTime)
+
+BOOST_AUTO_TEST_CASE (Simple)
+{
+ ndn::MillisecondsSince1970 value = ndn::getNowMilliseconds();
+ BOOST_CHECK_GT(value, 1390966967032);
+
+ BOOST_CHECK_EQUAL(ndn::toIsoString(1390966967032), "20140129T034247.032000");
+ BOOST_CHECK_EQUAL(ndn::fromIsoString("20140129T034247.032000"), 1390966967032);
+
+ BOOST_CHECK_EQUAL(ndn::fromIsoString("20140129T034247.032000Z"), 1390966967032);
+}
+
+BOOST_AUTO_TEST_SUITE_END()