]> git.ozlabs.org Git - ccan/blobdiff - ccan/time/test/run-monotonic.c
time: timemono_add.
[ccan] / ccan / time / test / run-monotonic.c
index 787ca6820b4c5c1976cdcaae526475eb506fd48f..c9912a73a608a0fcc7b1c92d5b44d95e067b2652 100644 (file)
@@ -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();
@@ -21,5 +21,8 @@ int main(void)
        ok1(time_less(timemono_between(t1, t2), 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();
 }