Alexander Afanasyev | 1e0a077 | 2014-01-28 20:07:07 -0800 | [diff] [blame^] | 1 | /** |
| 2 | * Copyright (C) 2013 Regents of the University of California. |
| 3 | * See COPYING for copyright and distribution information. |
| 4 | */ |
| 5 | |
| 6 | #include <boost/test/unit_test.hpp> |
| 7 | |
| 8 | #include <../src/util/time.hpp> |
| 9 | |
| 10 | BOOST_AUTO_TEST_SUITE(TestTime) |
| 11 | |
| 12 | BOOST_AUTO_TEST_CASE (Simple) |
| 13 | { |
| 14 | ndn::MillisecondsSince1970 value = ndn::getNowMilliseconds(); |
| 15 | BOOST_CHECK_GT(value, 1390966967032); |
| 16 | |
| 17 | BOOST_CHECK_EQUAL(ndn::toIsoString(1390966967032), "20140129T034247.032000"); |
| 18 | BOOST_CHECK_EQUAL(ndn::fromIsoString("20140129T034247.032000"), 1390966967032); |
| 19 | |
| 20 | BOOST_CHECK_EQUAL(ndn::fromIsoString("20140129T034247.032000Z"), 1390966967032); |
| 21 | } |
| 22 | |
| 23 | BOOST_AUTO_TEST_SUITE_END() |