blob: be4cc77de132fbebeeaaff66f88985f836c2ecc0 [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
Alexander Afanasyev0abb2da2014-01-30 18:07:57 -080010namespace ndn {
11
Alexander Afanasyev1e0a0772014-01-28 20:07:07 -080012BOOST_AUTO_TEST_SUITE(TestTime)
13
14BOOST_AUTO_TEST_CASE (Simple)
15{
Alexander Afanasyev0abb2da2014-01-30 18:07:57 -080016 MillisecondsSince1970 value = getNowMilliseconds();
Alexander Afanasyev1e0a0772014-01-28 20:07:07 -080017 BOOST_CHECK_GT(value, 1390966967032);
18
Alexander Afanasyev0abb2da2014-01-30 18:07:57 -080019 BOOST_CHECK_EQUAL(toIsoString(1390966967032), "20140129T034247.032000");
20 BOOST_CHECK_EQUAL(fromIsoString("20140129T034247.032000"), 1390966967032);
Alexander Afanasyev1e0a0772014-01-28 20:07:07 -080021
Alexander Afanasyev0abb2da2014-01-30 18:07:57 -080022 BOOST_CHECK_EQUAL(fromIsoString("20140129T034247.032000Z"), 1390966967032);
Alexander Afanasyev1e0a0772014-01-28 20:07:07 -080023}
24
25BOOST_AUTO_TEST_SUITE_END()
Alexander Afanasyev0abb2da2014-01-30 18:07:57 -080026
27} // namespace ndn