From 4b687f4c040c3fc3454e6b5fa25b633a644c02b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Kami=C5=84ski?= Date: Sun, 10 Jun 2018 23:03:54 +0200 Subject: [PATCH] Test is now C++11 compatible --- test/tz_test/local_time_conversion.pass.cpp | 23 ++++++++++----------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/test/tz_test/local_time_conversion.pass.cpp b/test/tz_test/local_time_conversion.pass.cpp index d47c71f..59bcdbf 100644 --- a/test/tz_test/local_time_conversion.pass.cpp +++ b/test/tz_test/local_time_conversion.pass.cpp @@ -5,7 +5,6 @@ int main() { using namespace date; - using namespace std::chrono_literals; using namespace std::chrono; /// sys epoch @@ -13,7 +12,7 @@ main() auto ls = local_days{1970_y/01/01_d}; auto st = clock_cast(ls); assert(clock_cast(st) == ls); - assert(st.time_since_epoch() == 0s); + assert(st.time_since_epoch() == seconds(0)); } /// sys 2000 case @@ -21,7 +20,7 @@ main() auto ls = local_days{2000_y/01/01_d}; auto st = clock_cast(ls); assert(clock_cast(st) == ls); - assert(st.time_since_epoch() == 946'684'800s); + assert(st.time_since_epoch() == seconds(946684800)); } @@ -30,7 +29,7 @@ main() auto lu = local_days{1970_y/01/01_d}; auto ut = clock_cast(lu); assert(clock_cast(ut) == lu); - assert(ut.time_since_epoch() == 0s); + assert(ut.time_since_epoch() == seconds(0)); } /// utc paper example @@ -38,7 +37,7 @@ main() auto lu = local_days{2000_y/01/01_d}; auto ut = clock_cast(lu); assert(clock_cast(ut) == lu); - assert(ut.time_since_epoch() == 946'684'822s); + assert(ut.time_since_epoch() == seconds(946684822)); } /// tai epoch @@ -46,16 +45,16 @@ main() auto lt = local_days{1958_y/01/01_d}; auto tt = clock_cast(lt); assert(clock_cast(tt) == lt); - assert(tt.time_since_epoch() == 0s); + assert(tt.time_since_epoch() == seconds(0)); - auto lu = local_days{1957_y/12/31_d} + 23h + 59min + 50s; + auto lu = local_days{1958_y/01/01_d} - seconds(10); auto ut = clock_cast(lu); assert(clock_cast(ut) == tt); } // tai paper example { - auto lt = local_days{2000_y/01/01_d} + 32s; + auto lt = local_days{2000_y/01/01_d} + seconds(32); auto tt = clock_cast(lt); assert(clock_cast(tt) == lt); @@ -69,13 +68,13 @@ main() auto lg = local_days{1980_y/01/Sunday[1]}; auto gt = clock_cast(lg); assert(clock_cast(gt) == lg); - assert(gt.time_since_epoch() == 0s); + assert(gt.time_since_epoch() == seconds(0)); auto lu = local_days{1980_y/01/Sunday[1]}; auto ut = clock_cast(lu); assert(clock_cast(ut) == gt); - auto lt = local_days{1980_y/01/Sunday[1]} + 19s; + auto lt = local_days{1980_y/01/Sunday[1]} + seconds(19); auto tt = clock_cast(lt); assert(clock_cast(tt) == gt); } @@ -86,11 +85,11 @@ main() auto gt = clock_cast(lg); assert(clock_cast(gt) == lg); - auto lu = local_days{2000_y/01/01_d} - 13s; + auto lu = local_days{2000_y/01/01_d} - seconds(13); auto ut = clock_cast(lu); assert(clock_cast(ut) == gt); - auto lt = local_days{2000_y/01/01_d} + 19s; + auto lt = local_days{2000_y/01/01_d} + seconds(19); auto tt = clock_cast(lt); assert(clock_cast(tt) == gt); }