1 #include <ccan/timer/timer.h>
2 /* Include the C files directly. */
3 #include <ccan/timer/timer.c>
4 #include <ccan/tap/tap.h>
10 struct list_head list;
12 /* This is how many tests you plan to run */
15 timers_init(&timers, grains_to_time(1364984760903400ULL));
16 ok1(timers.base == 1364984760903400ULL);
17 timer_add(&timers, &t, grains_to_time(1364984761003398ULL));
18 ok1(t.time == 1364984761003398ULL);
19 ok1(timers.first == 1364984761003398ULL);
20 timers_expire(&timers, grains_to_time(1364984760903444ULL), &list);
21 ok1(timers_check(&timers, NULL));
22 ok1(list_pop(&list, struct timer, list) == NULL);
23 timers_expire(&timers, grains_to_time(1364984761002667ULL), &list);
24 ok1(timers_check(&timers, NULL));
25 ok1(list_pop(&list, struct timer, list) == NULL);
27 timers_cleanup(&timers);
29 /* This exits depending on whether all tests passed */