blob: bc77fbdd3eac93135c9bf7a7f763aca9bb1d630e [file] [log] [blame]
Alexander Afanasyev1e0a0772014-01-28 20:07:07 -08001/**
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
10BOOST_AUTO_TEST_SUITE(TestTime)
11
12BOOST_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
23BOOST_AUTO_TEST_SUITE_END()