mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-10-31 22:25:25 -04:00
event-loop-test: assert non-NULL results
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
This commit is contained in:
parent
3a1be1e6fe
commit
5e096ccc94
1 changed files with 5 additions and 0 deletions
|
|
@ -48,10 +48,12 @@ TEST(event_loop_post_dispatch_check)
|
||||||
int dispatch_ran = 0;
|
int dispatch_ran = 0;
|
||||||
int p[2];
|
int p[2];
|
||||||
|
|
||||||
|
assert(loop);
|
||||||
assert(pipe(p) == 0);
|
assert(pipe(p) == 0);
|
||||||
|
|
||||||
source = wl_event_loop_add_fd(loop, p[0], WL_EVENT_READABLE,
|
source = wl_event_loop_add_fd(loop, p[0], WL_EVENT_READABLE,
|
||||||
fd_dispatch, &dispatch_ran);
|
fd_dispatch, &dispatch_ran);
|
||||||
|
assert(source);
|
||||||
wl_event_source_check(source);
|
wl_event_source_check(source);
|
||||||
|
|
||||||
wl_event_loop_dispatch(loop, 0);
|
wl_event_loop_dispatch(loop, 0);
|
||||||
|
|
@ -105,6 +107,8 @@ TEST(event_loop_free_source_with_data)
|
||||||
* run (and that we don't crash, of course).
|
* run (and that we don't crash, of course).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
assert(loop);
|
||||||
|
|
||||||
context.count = 0;
|
context.count = 0;
|
||||||
assert(pipe(context.p1) == 0);
|
assert(pipe(context.p1) == 0);
|
||||||
assert(pipe(context.p2) == 0);
|
assert(pipe(context.p2) == 0);
|
||||||
|
|
@ -184,6 +188,7 @@ TEST(event_loop_timer)
|
||||||
int got_it = 0;
|
int got_it = 0;
|
||||||
|
|
||||||
source = wl_event_loop_add_timer(loop, timer_callback, &got_it);
|
source = wl_event_loop_add_timer(loop, timer_callback, &got_it);
|
||||||
|
assert(source);
|
||||||
wl_event_source_timer_update(source, 10);
|
wl_event_source_timer_update(source, 10);
|
||||||
wl_event_loop_dispatch(loop, 0);
|
wl_event_loop_dispatch(loop, 0);
|
||||||
assert(!got_it);
|
assert(!got_it);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue