TimeTest.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006 #include <boost/test/auto_unit_test.hpp>
00007
00008 #include "Time.hpp"
00009
00010 using namespace benzene;
00011
00012
00013
00014 namespace {
00015
00016 BOOST_AUTO_TEST_CASE(Time_Constants)
00017 {
00018 BOOST_CHECK_EQUAL(Time::ONE_MINUTE, 60.0);
00019 BOOST_CHECK_EQUAL(Time::ONE_HOUR, 3600.0);
00020 BOOST_CHECK_EQUAL(Time::ONE_DAY, 86400.0);
00021 }
00022
00023 BOOST_AUTO_TEST_CASE(Time_GetTime)
00024 {
00025 }
00026
00027 BOOST_AUTO_TEST_CASE(Time_FormattedString)
00028 {
00029 BOOST_CHECK_EQUAL(Time::Formatted(0.0), "0s");
00030 BOOST_CHECK_EQUAL(Time::Formatted(100.0), "1m40s");
00031 BOOST_CHECK_EQUAL(Time::Formatted(6300.44287), "1h45m0.4429s");
00032 BOOST_CHECK_EQUAL(Time::Formatted(86711.130042), "1d5m11.13s");
00033
00034
00035 BOOST_CHECK_EQUAL(Time::Formatted(148337.6173), "1d17h12m17.62s");
00036 BOOST_CHECK(Time::Formatted(Time::Get()) != "0s");
00037 }
00038
00039 }
00040
00041