X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ftime%2Ftest%2Frun-monotonic.c;h=2da492d441b0160731ce4f431d31031c9b7e67a3;hp=ed70f3dbb5bddc19e15ed460c250f43fac236456;hb=61f58ff94e35c9b8ac5488554e2554bc5c9888b3;hpb=95ff2139520130dd98a0503e3c4f441c69a68f5a diff --git a/ccan/time/test/run-monotonic.c b/ccan/time/test/run-monotonic.c index ed70f3db..2da492d4 100644 --- a/ccan/time/test/run-monotonic.c +++ b/ccan/time/test/run-monotonic.c @@ -7,7 +7,7 @@ int main(void) struct timemono t1, t2; struct timerel t3; - plan_tests(2); + plan_tests(5); /* Test time_mono */ t1 = time_mono(); @@ -18,7 +18,11 @@ int main(void) t3.ts.tv_sec = 1; t3.ts.tv_nsec = 0; - ok1(time_less(timemono_between(t1, t2), t3)); + ok1(time_less(timemono_between(t2, t1), t3)); + ok1(time_less(timemono_since(t1), t3)); + + ok1(timemono_add(t1, t3).ts.tv_sec == t1.ts.tv_sec + 1); + ok1(timemono_add(t2, t3).ts.tv_nsec == t2.ts.tv_nsec); return exit_status(); }