diff options
Diffstat (limited to 'graphics/wayland/files/patch-tests_event-loop-test.c')
-rw-r--r-- | graphics/wayland/files/patch-tests_event-loop-test.c | 49 |
1 files changed, 27 insertions, 22 deletions
diff --git a/graphics/wayland/files/patch-tests_event-loop-test.c b/graphics/wayland/files/patch-tests_event-loop-test.c index 05024c452ba4..6480c4b86ee1 100644 --- a/graphics/wayland/files/patch-tests_event-loop-test.c +++ b/graphics/wayland/files/patch-tests_event-loop-test.c @@ -1,6 +1,6 @@ ---- tests/event-loop-test.c.orig 2017-08-08 18:20:52 UTC +--- tests/event-loop-test.c.orig 2020-02-11 23:46:03 UTC +++ tests/event-loop-test.c -@@ -167,10 +167,10 @@ TEST(event_loop_signal) +@@ -168,10 +168,10 @@ TEST(event_loop_signal) signal_callback, &got_it); assert(source); @@ -14,26 +14,31 @@ assert(got_it == 1); wl_event_source_remove(source); -@@ -234,11 +234,19 @@ TEST(event_loop_timer) +@@ -235,11 +235,11 @@ TEST(event_loop_timer) - source = wl_event_loop_add_timer(loop, timer_callback, &got_it); - assert(source); -- wl_event_source_timer_update(source, 10); -- wl_event_loop_dispatch(loop, 0); -+ assert(wl_event_source_timer_update(source, 10) == 0); -+ assert(wl_event_loop_dispatch(loop, 0) == 0); - assert(!got_it); -- wl_event_loop_dispatch(loop, 20); -+ /* FreeBSD has a bug where it converts ms_timeout to ticks; it always adds 1 to the tick count. -+ * Consequently, we need to grossly overcompensate here. -+ * See: http://unix.derkeiler.com/Mailing-Lists/FreeBSD/hackers/2012-07/msg00319.html */ -+ assert(wl_event_loop_dispatch(loop, 50) == 0); + source1 = wl_event_loop_add_timer(loop, timer_callback, &got_it); + assert(source1); +- wl_event_source_timer_update(source1, 20); ++ assert(wl_event_source_timer_update(source1, 20) == 0); + + source2 = wl_event_loop_add_timer(loop, timer_callback, &got_it); + assert(source2); +- wl_event_source_timer_update(source2, 100); ++ assert(wl_event_source_timer_update(source2, 100) == 0); + + /* Check that the timer marked for 20 msec from now fires within 30 + * msec, and that the timer marked for 100 msec is expected to fire +@@ -248,11 +248,11 @@ TEST(event_loop_timer) + + wl_event_loop_dispatch(loop, 0); + assert(got_it == 0); +- wl_event_loop_dispatch(loop, 30); ++ assert(wl_event_loop_dispatch(loop, 30) == 0); assert(got_it == 1); -+ -+ /* Check it doesn't fire again. */ -+ got_it = 0; -+ assert(wl_event_loop_dispatch(loop, 20) == 0); -+ assert(!got_it); + wl_event_loop_dispatch(loop, 0); + assert(got_it == 1); +- wl_event_loop_dispatch(loop, 90); ++ assert(wl_event_loop_dispatch(loop, 90) == 0); + assert(got_it == 2); - wl_event_source_remove(source); - wl_event_loop_destroy(loop); + wl_event_source_remove(source1); |