]>
git.saurik.com Git - apple/libdispatch.git/blob - testing/dispatch_timer_oneshot.c
6 #include <dispatch/dispatch.h>
8 #include "dispatch_test.h"
11 oneshot(void* context
__attribute__((unused
)), dispatch_event_t de
)
13 dispatch_source_t ds
= dispatch_event_get_source(de
);
14 test_ptr_notnull("dispatch_event_get_source", ds
);
16 if (!dispatch_event_get_error(de
, NULL
)) {
17 long canceled
= dispatch_testcancel(ds
);
18 test_long("dispatch_testcancel", canceled
, 0);
28 test_start("Dispatch Timer One-Shot");
32 s
= dispatch_source_timer_create_f(DISPATCH_TIMER_ONESHOT
,
33 (uint64_t)1000000000ull, // 1s
36 dispatch_get_concurrent_queue(0),