diff options
| author | Quentin Glidic <sardemff7+git@sardemff7.net> | 2013-01-06 15:46:00 +0100 |
|---|---|---|
| committer | Kristian Høgsberg <krh@bitplanet.net> | 2013-01-11 15:12:45 -0500 |
| commit | 0d2c233e15137abf9c9ec55b8b9b120318af1375 (patch) | |
| tree | 9c7ec5abf0c2cf45fc292cfd65b577b68f8aed79 /tests/event-loop-test.c | |
| parent | client: remove two unused function pointer typedefs (diff) | |
| download | wayland-0d2c233e15137abf9c9ec55b8b9b120318af1375.tar wayland-0d2c233e15137abf9c9ec55b8b9b120318af1375.tar.gz wayland-0d2c233e15137abf9c9ec55b8b9b120318af1375.tar.bz2 wayland-0d2c233e15137abf9c9ec55b8b9b120318af1375.tar.lz wayland-0d2c233e15137abf9c9ec55b8b9b120318af1375.tar.xz wayland-0d2c233e15137abf9c9ec55b8b9b120318af1375.tar.zst wayland-0d2c233e15137abf9c9ec55b8b9b120318af1375.zip | |
test/event-loop: Check readable state on a pipe
When redirecting stdout to a non-readable file makes the test fail as a
false negative
Diffstat (limited to 'tests/event-loop-test.c')
| -rw-r--r-- | tests/event-loop-test.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/event-loop-test.c b/tests/event-loop-test.c index e630cde..2f3dcd4 100644 --- a/tests/event-loop-test.c +++ b/tests/event-loop-test.c @@ -43,14 +43,19 @@ TEST(event_loop_post_dispatch_check) struct wl_event_loop *loop = wl_event_loop_create(); struct wl_event_source *source; int dispatch_ran = 0; + int p[2]; - source = wl_event_loop_add_fd(loop, 1, WL_EVENT_READABLE, + assert(pipe(p) == 0); + + source = wl_event_loop_add_fd(loop, p[0], WL_EVENT_READABLE, fd_dispatch, &dispatch_ran); wl_event_source_check(source); wl_event_loop_dispatch(loop, 0); assert(dispatch_ran); + assert(close(p[0]) == 0); + assert(close(p[1]) == 0); wl_event_source_remove(source); wl_event_loop_destroy(loop); } |
