From dd91be668e2fc9e1dd6e8548f6a6dacee653974e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Kami=C5=84ski?= Date: Fri, 24 Nov 2017 23:42:18 +0100 Subject: [PATCH] Added deprecated functions test for real --- test/clock_cast_test/deprecated.pass.cpp | 36 ++++++++---------------- 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/test/clock_cast_test/deprecated.pass.cpp b/test/clock_cast_test/deprecated.pass.cpp index b2f427b..b6de6b9 100644 --- a/test/clock_cast_test/deprecated.pass.cpp +++ b/test/clock_cast_test/deprecated.pass.cpp @@ -27,26 +27,14 @@ int main() { using namespace date; - using sys_clock = std::chrono::system_clock; - - // self - { - sys_days st(1997_y/dec/12); - auto ut = utc_clock::from_sys(st); - auto tt = tai_clock::from_utc(ut); - - assert(clock_cast(st) == st); - assert(clock_cast(ut) == ut); - assert(clock_cast(tt) == tt); - } // sys <-> utc { sys_days st(1997_y/dec/12); auto ut = utc_clock::from_sys(st); - assert(clock_cast(st) == ut); - assert(clock_cast(ut) == st); + assert(to_utc_time(st) == ut); + assert(to_sys_time(ut) == st); } // tai <-> utc @@ -55,8 +43,8 @@ main() auto ut = utc_clock::from_sys(st); auto tt = tai_clock::from_utc(ut); - assert(clock_cast(ut) == tt); - assert(clock_cast(tt) == ut); + assert(to_tai_time(ut) == tt); + assert(to_utc_time(tt) == ut); } // tai <-> sys @@ -65,8 +53,8 @@ main() auto ut = utc_clock::from_sys(st); auto tt = tai_clock::from_utc(ut); - assert(clock_cast(st) == tt); - assert(clock_cast(tt) == st); + assert(to_tai_time(st) == tt); + assert(to_sys_time(tt) == st); } // gps <-> utc @@ -75,8 +63,8 @@ main() auto ut = utc_clock::from_sys(st); auto gt = gps_clock::from_utc(ut); - assert(clock_cast(ut) == gt); - assert(clock_cast(gt) == ut); + assert(to_gps_time(ut) == gt); + assert(to_utc_time(gt) == ut); } // gps <-> sys @@ -85,8 +73,8 @@ main() auto ut = utc_clock::from_sys(st); auto gt = gps_clock::from_utc(ut); - assert(clock_cast(st) == gt); - assert(clock_cast(gt) == st); + assert(to_gps_time(st) == gt); + assert(to_sys_time(gt) == st); } // tai <-> gps @@ -96,7 +84,7 @@ main() auto tt = tai_clock::from_utc(ut); auto gt = gps_clock::from_utc(ut); - assert(clock_cast(tt) == gt); - assert(clock_cast(gt) == tt); + assert(to_gps_time(tt) == gt); + assert(to_tai_time(gt) == tt); } }