X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Ftime%2Ftest%2Frun-monotonic.c;h=2da492d441b0160731ce4f431d31031c9b7e67a3;hb=d16685e327c01b79bf4b49793f56cbe3e33ff179;hp=787ca6820b4c5c1976cdcaae526475eb506fd48f;hpb=c0b655441804c0edace4f539fb9008b315eb1bd8;p=ccan diff --git a/ccan/time/test/run-monotonic.c b/ccan/time/test/run-monotonic.c index 787ca682..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(3); + plan_tests(5); /* Test time_mono */ t1 = time_mono(); @@ -18,8 +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(); }