X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Ftimer%2Ftest%2Frun.c;fp=ccan%2Ftimer%2Ftest%2Frun.c;h=f7b711f2c8530cb98183baf10ed07770f3fc4264;hb=fe6bc8c530795a6c718f7e8fd1a6643d9f3024a1;hp=cebc99ce7e5f69544ce89c7f4dedebfa677ea170;hpb=2ecae4f3ae8880196794704029c90d0285c8cb80;p=ccan diff --git a/ccan/timer/test/run.c b/ccan/timer/test/run.c index cebc99ce..f7b711f2 100644 --- a/ccan/timer/test/run.c +++ b/ccan/timer/test/run.c @@ -13,7 +13,6 @@ int main(void) { struct timers timers; struct timer t[64]; - struct list_head expired; struct timeabs earliest; uint64_t i; struct timeabs epoch = { { 0, 0 } }; @@ -69,13 +68,11 @@ int main(void) struct timer *t1, *t2; ok1(timer_earliest(&timers, &earliest)); - timers_expire(&timers, earliest, &expired); - - t1 = list_pop(&expired, struct timer, list); + t1 = timers_expire(&timers, earliest); ok1(t1); - t2 = list_pop(&expired, struct timer, list); + t2 = timers_expire(&timers, earliest); ok1(t2); - ok1(list_empty(&expired)); + ok1(!timers_expire(&timers, earliest)); ok1(t1 == &t[i*2] || t1 == &t[i*2+1]); ok1(t2 != t1 && (t2 == &t[i*2] || t2 == &t[i*2+1]));