X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=test%2Ftime%2Fmain.cpp;fp=test%2Ftime%2Fmain.cpp;h=663150940641fbb440c3426b3a42094008d4b33f;hb=294a78c6bf69289126940ac2348a89ecd536be12;hp=77d0af3a3267b0ed0dd1293df36fd61d487fb056;hpb=bebea4009ed5a273fbf9ed3644a2140a8f477f99;p=anna.git diff --git a/test/time/main.cpp b/test/time/main.cpp index 77d0af3..6631509 100644 --- a/test/time/main.cpp +++ b/test/time/main.cpp @@ -61,27 +61,21 @@ BOOST_AUTO_TEST_CASE(date) { std::string ntpStr = current2.asString(); current2.storeUnix(unixtime); std::string unixStr = current2.asString(); - BOOST_REQUIRE_EQUAL(ntpStr, unixStr); - anna::time::Date myBirth("CET"); // 19 December 1974, 10:00 (GMT+1 = UTC + 1 = CET) //anna::time::Date myBirth; // if Context TZ = shell TZ = "CET" myBirth.store("19741219101500"); // yyyymmddHHmmss - anna::time::Date same_moment_canary_island("GMT"); same_moment_canary_island.store(myBirth.getUnixTimestamp()); myBirth.setTzContext("GMT"); BOOST_REQUIRE_EQUAL(same_moment_canary_island.yyyymmddHHmmss(), myBirth.yyyymmddHHmmss()); - anna::time::Date birthday("EET"); birthday.store(same_moment_canary_island.getTm(), "GMT"); // TZ origin = "GMT" //BOOST_REQUIRE_EQUAL(birthday, myBirth); BOOST_REQUIRE_EQUAL(birthday.getUnixTimestamp(), myBirth.getUnixTimestamp()); - myBirth.setTzContext(anna::time::functions::getLocalTz().getValue().c_str()); birthday.setTzContext(anna::time::functions::getLocalTz().getValue().c_str()); // Go from "EET" to "CET" BOOST_REQUIRE_EQUAL(myBirth.yyyymmddHHmmss(), birthday.yyyymmddHHmmss()); - // Adding 18 years to 'myBirth': struct tm Tm = myBirth.getTm(); Tm.tm_year += 18;