diff options
author | RALOVICH, Kristof <tade60@freemail.hu> | 2014-04-08 15:34:35 +0200 |
---|---|---|
committer | RALOVICH, Kristof <tade60@freemail.hu> | 2014-04-08 15:34:35 +0200 |
commit | 7d4c603f3cbd234c98a1c101d63a177fd439e665 (patch) | |
tree | f9da0e9cf8bc524ff24eb93383bb49543088182c /src | |
parent | 46acf301ea9a3469f5cf1631acd1cb13f4f44bb2 (diff) |
tests: str2time still fails under win, but at least not crashes
i suspect the problem is that the time conversion doesn't happen in GMT
Diffstat (limited to 'src')
-rw-r--r-- | src/tests/testDeviceSettings.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/tests/testDeviceSettings.cpp b/src/tests/testDeviceSettings.cpp index 74a8904..d569e03 100644 --- a/src/tests/testDeviceSettings.cpp +++ b/src/tests/testDeviceSettings.cpp @@ -64,6 +64,21 @@ BOOST_AUTO_TEST_CASE( free_test_function ) LOG(LOG_INF) << getVersionString() << "\n"; } +BOOST_AUTO_TEST_CASE(convert_0) +{ + // $ date -u +%F\ %X\ %s + // 2013-07-06 08:40:16 PM 1373143216 + // 2013-07-06 09:01:28 PM 1373144488 + { + const char* s="2013-07-06T20:40:16Z"; + std::time_t t=1373143216; + + //LOG(LOG_INF) << DeviceSettings::str2time(s) << "\t" << t << "\n" << std::endl; + } + + BOOST_CHECK( true /* test assertion */ ); +} + BOOST_AUTO_TEST_CASE(convert) { // $ date -u +%F\ %X\ %s @@ -73,7 +88,7 @@ BOOST_AUTO_TEST_CASE(convert) const char* s="2013-07-06T20:40:16Z"; std::time_t t=1373143216; - //std::cout << DeviceSettings::str2time(s) << "\n"; + //LOG(LOG_INF) << DeviceSettings::str2time(s) << "\t" << t << "\n" << std::endl; BOOST_CHECK(DeviceSettings::str2time(s) == t); |