]> git.ozlabs.org Git - ccan/blob - ccan/timer/test/run-ff.c
endian: add constant versions.
[ccan] / ccan / timer / test / run-ff.c
1 #include <ccan/timer/timer.h>
2 /* Include the C files directly. */
3 #include <ccan/timer/timer.c>
4 #include <ccan/tap/tap.h>
5
6 int main(void)
7 {
8         struct timers timers;
9         struct timer t;
10         struct list_head expired;
11
12         /* This is how many tests you plan to run */
13         plan_tests(3);
14
15         timers_init(&timers, time_from_usec(1364726722653919ULL));
16         timer_add(&timers, &t, time_from_usec(1364726722703919ULL));
17         timers_expire(&timers, time_from_usec(1364726722653920ULL), &expired);
18         ok1(list_empty(&expired));
19         timers_expire(&timers, time_from_usec(1364726725454187ULL), &expired);
20         ok1(!list_empty(&expired));
21         ok1(list_top(&expired, struct timer, list) == &t);
22
23         timers_cleanup(&timers);
24
25         /* This exits depending on whether all tests passed */
26         return exit_status();
27 }