X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Ftime%2Ftest%2Frun.c;h=21c722134865a919175ed69c6eefd45fcb8ccb63;hb=fe5952874bfb47b8d2c087c93d2149aea6ec2f44;hp=7f4366005b693ab66318613ae5c6537fde0ac1a2;hpb=2012d45e273c3016dbd09b2606efc9ffab07c57f;p=ccan diff --git a/ccan/time/test/run.c b/ccan/time/test/run.c index 7f436600..21c72213 100644 --- a/ccan/time/test/run.c +++ b/ccan/time/test/run.c @@ -6,7 +6,7 @@ int main(void) { struct timespec t1, t2, t3, zero = { 0, 0 }; - plan_tests(58); + plan_tests(61); /* Test time_now */ t1 = time_now(); @@ -51,6 +51,12 @@ int main(void) t3 = time_sub(t2, t2); ok1(time_eq(t3, zero)); + /* time_from_sec / time_to_sec */ + t3 = time_from_sec(500); + ok1(t3.tv_sec == 500); + ok1(t3.tv_nsec == 0); + ok1(time_to_sec(t3) == 500); + /* time_from_msec / time_to_msec */ t3 = time_from_msec(500); ok1(t3.tv_sec == 0);