File tree Expand file tree Collapse file tree 4 files changed +20
-12
lines changed
libcxx/test/std/time/time.point/time.point.arithmetic Expand file tree Collapse file tree 4 files changed +20
-12
lines changed Original file line number Diff line number Diff line change 1919#include " test_macros.h"
2020
2121constexpr bool test () {
22- typedef std::chrono::system_clock Clock ;
23- typedef std::chrono::milliseconds Duration ;
22+ using Clock = std::chrono::system_clock;
23+ using Duration = std::chrono::milliseconds;
2424 std::chrono::time_point<Clock, Duration> t{Duration{5 }};
2525 std::chrono::time_point<Clock, Duration>& tref{++t};
26- return &tref == &t && tref.time_since_epoch () == Duration{6 };
26+ assert (&tref == &t);
27+ assert (tref.time_since_epoch () == Duration{6 });
28+ return true ;
2729}
2830
2931int main (int , char **) {
Original file line number Diff line number Diff line change 1919#include " test_macros.h"
2020
2121constexpr bool test () {
22- typedef std::chrono::system_clock Clock ;
23- typedef std::chrono::milliseconds Duration ;
22+ using Clock = std::chrono::system_clock;
23+ using Duration = std::chrono::milliseconds;
2424 std::chrono::time_point<Clock, Duration> t1{Duration{3 }};
2525 std::chrono::time_point<Clock, Duration> t2{t1++};
26- return t1.time_since_epoch () == Duration{4 } && t2.time_since_epoch () == Duration{3 };
26+ assert (t1.time_since_epoch () == Duration{4 });
27+ assert (t2.time_since_epoch () == Duration{3 });
28+ return true ;
2729}
2830
2931int main (int , char **) {
Original file line number Diff line number Diff line change 1919#include " test_macros.h"
2020
2121constexpr bool test () {
22- typedef std::chrono::system_clock Clock ;
23- typedef std::chrono::milliseconds Duration ;
22+ using Clock = std::chrono::system_clock;
23+ using Duration = std::chrono::milliseconds;
2424 std::chrono::time_point<Clock, Duration> t{Duration{5 }};
2525 std::chrono::time_point<Clock, Duration>& tref{--t};
26- return &tref == &t && tref.time_since_epoch () == Duration{4 };
26+ assert (&tref == &t);
27+ assert (tref.time_since_epoch () == Duration{4 });
28+ return true ;
2729}
2830
2931int main (int , char **) {
Original file line number Diff line number Diff line change 1919#include " test_macros.h"
2020
2121constexpr bool test () {
22- typedef std::chrono::system_clock Clock ;
23- typedef std::chrono::milliseconds Duration ;
22+ using Clock = std::chrono::system_clock;
23+ using Duration = std::chrono::milliseconds;
2424 std::chrono::time_point<Clock, Duration> t1{Duration{3 }};
2525 std::chrono::time_point<Clock, Duration> t2{t1--};
26- return t1.time_since_epoch () == Duration{2 } && t2.time_since_epoch () == Duration{3 };
26+ assert (t1.time_since_epoch () == Duration{2 });
27+ assert (t2.time_since_epoch () == Duration{3 });
28+ return true ;
2729}
2830
2931int main (int , char **) {
You can’t perform that action at this time.
0 commit comments