mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-23 10:40:05 +01:00
test: add a bunch of libinput_dispatch() before timeout calls
98346f6a1a 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>
This commit is contained in:
parent
42c25dcb89
commit
5cec16eede
1 changed files with 12 additions and 0 deletions
|
|
@ -3165,6 +3165,7 @@ START_TEST(touchpad_thumb_tap_begin)
|
||||||
/* touch down is a thumb */
|
/* touch down is a thumb */
|
||||||
litest_touch_down_extended(dev, 0, 50, 99, axes);
|
litest_touch_down_extended(dev, 0, 50, 99, axes);
|
||||||
litest_touch_up(dev, 0);
|
litest_touch_up(dev, 0);
|
||||||
|
libinput_dispatch(li);
|
||||||
litest_timeout_tap();
|
litest_timeout_tap();
|
||||||
|
|
||||||
litest_assert_empty_queue(li);
|
litest_assert_empty_queue(li);
|
||||||
|
|
@ -3172,6 +3173,7 @@ START_TEST(touchpad_thumb_tap_begin)
|
||||||
/* make sure normal tap still works */
|
/* make sure normal tap still works */
|
||||||
litest_touch_down(dev, 0, 50, 99);
|
litest_touch_down(dev, 0, 50, 99);
|
||||||
litest_touch_up(dev, 0);
|
litest_touch_up(dev, 0);
|
||||||
|
libinput_dispatch(li);
|
||||||
litest_timeout_tap();
|
litest_timeout_tap();
|
||||||
litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_BUTTON);
|
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_down(dev, 0, 50, 50);
|
||||||
litest_touch_move_extended(dev, 0, 51, 99, axes);
|
litest_touch_move_extended(dev, 0, 51, 99, axes);
|
||||||
litest_touch_up(dev, 0);
|
litest_touch_up(dev, 0);
|
||||||
|
libinput_dispatch(li);
|
||||||
litest_timeout_tap();
|
litest_timeout_tap();
|
||||||
litest_assert_empty_queue(li);
|
litest_assert_empty_queue(li);
|
||||||
|
|
||||||
/* make sure normal tap still works */
|
/* make sure normal tap still works */
|
||||||
litest_touch_down(dev, 0, 50, 99);
|
litest_touch_down(dev, 0, 50, 99);
|
||||||
litest_touch_up(dev, 0);
|
litest_touch_up(dev, 0);
|
||||||
|
libinput_dispatch(li);
|
||||||
litest_timeout_tap();
|
litest_timeout_tap();
|
||||||
litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_BUTTON);
|
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 */
|
/* event in state HOLD is thumb */
|
||||||
litest_touch_down(dev, 0, 50, 99);
|
litest_touch_down(dev, 0, 50, 99);
|
||||||
|
libinput_dispatch(li);
|
||||||
litest_timeout_tap();
|
litest_timeout_tap();
|
||||||
libinput_dispatch(li);
|
libinput_dispatch(li);
|
||||||
litest_touch_move_extended(dev, 0, 51, 99, axes);
|
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 */
|
/* make sure normal tap still works */
|
||||||
litest_touch_down(dev, 0, 50, 99);
|
litest_touch_down(dev, 0, 50, 99);
|
||||||
litest_touch_up(dev, 0);
|
litest_touch_up(dev, 0);
|
||||||
|
libinput_dispatch(li);
|
||||||
litest_timeout_tap();
|
litest_timeout_tap();
|
||||||
litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_BUTTON);
|
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 */
|
/* event in state HOLD is thumb */
|
||||||
litest_touch_down(dev, 0, 50, 99);
|
litest_touch_down(dev, 0, 50, 99);
|
||||||
|
libinput_dispatch(li);
|
||||||
litest_timeout_tap();
|
litest_timeout_tap();
|
||||||
libinput_dispatch(li);
|
libinput_dispatch(li);
|
||||||
litest_touch_move_extended(dev, 0, 51, 99, axes);
|
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);
|
litest_assert_empty_queue(li);
|
||||||
|
|
||||||
/* timeout -> into HOLD, no event on release */
|
/* timeout -> into HOLD, no event on release */
|
||||||
|
libinput_dispatch(li);
|
||||||
litest_timeout_tap();
|
litest_timeout_tap();
|
||||||
libinput_dispatch(li);
|
libinput_dispatch(li);
|
||||||
litest_touch_up(dev, 1);
|
litest_touch_up(dev, 1);
|
||||||
|
|
@ -3281,6 +3289,7 @@ START_TEST(touchpad_thumb_tap_hold_2ndfg)
|
||||||
/* make sure normal tap still works */
|
/* make sure normal tap still works */
|
||||||
litest_touch_down(dev, 0, 50, 99);
|
litest_touch_down(dev, 0, 50, 99);
|
||||||
litest_touch_up(dev, 0);
|
litest_touch_up(dev, 0);
|
||||||
|
libinput_dispatch(li);
|
||||||
litest_timeout_tap();
|
litest_timeout_tap();
|
||||||
litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_BUTTON);
|
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 */
|
/* event in state HOLD is thumb */
|
||||||
litest_touch_down(dev, 0, 50, 99);
|
litest_touch_down(dev, 0, 50, 99);
|
||||||
|
libinput_dispatch(li);
|
||||||
litest_timeout_tap();
|
litest_timeout_tap();
|
||||||
libinput_dispatch(li);
|
libinput_dispatch(li);
|
||||||
litest_touch_move_extended(dev, 0, 51, 99, axes);
|
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_BUTTON_STATE_PRESSED);
|
||||||
libinput_event_destroy(libinput_event_pointer_get_base_event(ptrev));
|
libinput_event_destroy(libinput_event_pointer_get_base_event(ptrev));
|
||||||
|
|
||||||
|
libinput_dispatch(li);
|
||||||
litest_timeout_tap();
|
litest_timeout_tap();
|
||||||
libinput_dispatch(li);
|
libinput_dispatch(li);
|
||||||
event = libinput_get_event(li);
|
event = libinput_get_event(li);
|
||||||
|
|
@ -3339,6 +3350,7 @@ START_TEST(touchpad_thumb_tap_hold_2ndfg_tap)
|
||||||
/* make sure normal tap still works */
|
/* make sure normal tap still works */
|
||||||
litest_touch_down(dev, 0, 50, 99);
|
litest_touch_down(dev, 0, 50, 99);
|
||||||
litest_touch_up(dev, 0);
|
litest_touch_up(dev, 0);
|
||||||
|
libinput_dispatch(li);
|
||||||
litest_timeout_tap();
|
litest_timeout_tap();
|
||||||
litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_BUTTON);
|
litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_BUTTON);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue