blob: d59400e9dd27b725cfd48d82a45f8560f3622b69 [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
Alexander Afanasyev09c613f2014-01-29 00:23:58 -08008#include "util/time.hpp"
Alexander Afanasyev1e0a0772014-01-28 20:07:07 -08009
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()