diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2015-07-29 09:52:28 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2015-07-29 09:52:28 +1000 |
commit | 5cec16eede70f6df44b1c39faae614a66594d774 (patch) | |
tree | 1ea534271867a21c8c13db3cd77cca1a0b825941 | |
parent | 42c25dcb89b9391fe73a60b111c77db6532db746 (diff) |
test: add a bunch of libinput_dispatch() before timeout calls
98346f6a1aa added a warning about timeouts expiring before now. Those warnings
are triggered by a bunch of tests where we have events, then a timeout, then a
libinput_dispatch().
All these are bugs in the test, since we can't guarantee the order of fds (and
thus which fd the events are pulled off first) it's just lucky that they worked.
Insert the required libinput_dispatch() calls.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ã…dahl <jadahl@gmail.com>
-rw-r--r-- | test/touchpad.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/touchpad.c b/test/touchpad.c index 1935d19..8489861 100644 --- a/test/touchpad.c +++ b/test/touchpad.c @@ -3165,6 +3165,7 @@ START_TEST(touchpad_thumb_tap_begin) /* touch down is a thumb */ litest_touch_down_extended(dev, 0, 50, 99, axes); litest_touch_up(dev, 0); + libinput_dispatch(li); litest_timeout_tap(); litest_assert_empty_queue(li); @@ -3172,6 +3173,7 @@ START_TEST(touchpad_thumb_tap_begin) /* make sure normal tap still works */ litest_touch_down(dev, 0, 50, 99); litest_touch_up(dev, 0); + libinput_dispatch(li); litest_timeout_tap(); litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_BUTTON); } @@ -3197,12 +3199,14 @@ START_TEST(touchpad_thumb_tap_touch) litest_touch_down(dev, 0, 50, 50); litest_touch_move_extended(dev, 0, 51, 99, axes); litest_touch_up(dev, 0); + libinput_dispatch(li); litest_timeout_tap(); litest_assert_empty_queue(li); /* make sure normal tap still works */ litest_touch_down(dev, 0, 50, 99); litest_touch_up(dev, 0); + libinput_dispatch(li); litest_timeout_tap(); litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_BUTTON); } @@ -3226,6 +3230,7 @@ START_TEST(touchpad_thumb_tap_hold) /* event in state HOLD is thumb */ litest_touch_down(dev, 0, 50, 99); + libinput_dispatch(li); litest_timeout_tap(); libinput_dispatch(li); litest_touch_move_extended(dev, 0, 51, 99, axes); @@ -3235,6 +3240,7 @@ START_TEST(touchpad_thumb_tap_hold) /* make sure normal tap still works */ litest_touch_down(dev, 0, 50, 99); litest_touch_up(dev, 0); + libinput_dispatch(li); litest_timeout_tap(); litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_BUTTON); } @@ -3258,6 +3264,7 @@ START_TEST(touchpad_thumb_tap_hold_2ndfg) /* event in state HOLD is thumb */ litest_touch_down(dev, 0, 50, 99); + libinput_dispatch(li); litest_timeout_tap(); libinput_dispatch(li); litest_touch_move_extended(dev, 0, 51, 99, axes); @@ -3273,6 +3280,7 @@ START_TEST(touchpad_thumb_tap_hold_2ndfg) litest_assert_empty_queue(li); /* timeout -> into HOLD, no event on release */ + libinput_dispatch(li); litest_timeout_tap(); libinput_dispatch(li); litest_touch_up(dev, 1); @@ -3281,6 +3289,7 @@ START_TEST(touchpad_thumb_tap_hold_2ndfg) /* make sure normal tap still works */ litest_touch_down(dev, 0, 50, 99); litest_touch_up(dev, 0); + libinput_dispatch(li); litest_timeout_tap(); litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_BUTTON); } @@ -3305,6 +3314,7 @@ START_TEST(touchpad_thumb_tap_hold_2ndfg_tap) /* event in state HOLD is thumb */ litest_touch_down(dev, 0, 50, 99); + libinput_dispatch(li); litest_timeout_tap(); libinput_dispatch(li); litest_touch_move_extended(dev, 0, 51, 99, axes); @@ -3328,6 +3338,7 @@ START_TEST(touchpad_thumb_tap_hold_2ndfg_tap) LIBINPUT_BUTTON_STATE_PRESSED); libinput_event_destroy(libinput_event_pointer_get_base_event(ptrev)); + libinput_dispatch(li); litest_timeout_tap(); libinput_dispatch(li); event = libinput_get_event(li); @@ -3339,6 +3350,7 @@ START_TEST(touchpad_thumb_tap_hold_2ndfg_tap) /* make sure normal tap still works */ litest_touch_down(dev, 0, 50, 99); litest_touch_up(dev, 0); + libinput_dispatch(li); litest_timeout_tap(); litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_BUTTON); } |