From 9e043fb7bcd7e5795f2d7a6c2ae5ec60df072731 Mon Sep 17 00:00:00 2001 From: Valera Cogut Date: Fri, 27 Jul 2018 10:27:28 +0300 Subject: [PATCH 1/2] fc::time_point_sec::to_iso_string is broken - issue #597 --- tests/time_test.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/time_test.cpp b/tests/time_test.cpp index dee272d..690d66c 100644 --- a/tests/time_test.cpp +++ b/tests/time_test.cpp @@ -1,5 +1,5 @@ #include - +#include #include using namespace fc; @@ -38,8 +38,11 @@ BOOST_AUTO_TEST_CASE(time_point_sec_test) time_point_sec tp3g(0xc0000000U); // commented next 2 tests as they will only work with boost >= 1.64 - //BOOST_CHECK_EQUAL( "2072-01-28T16:51:12", tp3g.to_iso_string() ); - //BOOST_CHECK_EQUAL( "20720128T165112", tp3g.to_non_delimited_iso_string() ); + + if (BOOST_VERSION >= BOOST_VERSION_NUMBER(1,64,0)) { + BOOST_CHECK_EQUAL( "2072-01-28T16:51:12", tp3g.to_iso_string() ); + BOOST_CHECK_EQUAL( "20720128T165112", tp3g.to_non_delimited_iso_string() ); + } BOOST_CHECK( tp0 == time_point_sec() ); BOOST_CHECK( tp0 < tp1 ); From 0077926a7c55a6df64a353a0e8f7caef7c36652f Mon Sep 17 00:00:00 2001 From: Valera Cogut Date: Fri, 27 Jul 2018 15:00:10 +0300 Subject: [PATCH 2/2] removed comment --- tests/time_test.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/time_test.cpp b/tests/time_test.cpp index 690d66c..4c45720 100644 --- a/tests/time_test.cpp +++ b/tests/time_test.cpp @@ -37,8 +37,6 @@ BOOST_AUTO_TEST_CASE(time_point_sec_test) BOOST_CHECK_EQUAL( "20380119T031408", tp2g.to_non_delimited_iso_string() ); time_point_sec tp3g(0xc0000000U); - // commented next 2 tests as they will only work with boost >= 1.64 - if (BOOST_VERSION >= BOOST_VERSION_NUMBER(1,64,0)) { BOOST_CHECK_EQUAL( "2072-01-28T16:51:12", tp3g.to_iso_string() ); BOOST_CHECK_EQUAL( "20720128T165112", tp3g.to_non_delimited_iso_string() );