From f9b1875ab4e4f55798932a558bf3aeec347def7b Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 27 Aug 2018 15:19:58 +1000 Subject: [PATCH] test: fix a DWT test, only worked because of timing success This test only succeeded because all events were sent within the dwt timeout. Change it to actually test the behavior of a touch being disabled by DWT and staying disabled. Signed-off-by: Peter Hutterer --- test/test-touchpad.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/test-touchpad.c b/test/test-touchpad.c index 6cf049dc..c3c66507 100644 --- a/test/test-touchpad.c +++ b/test/test-touchpad.c @@ -4255,12 +4255,19 @@ START_TEST(touchpad_dwt_disable_during_touch) litest_keyboard_key(keyboard, KEY_A, true); litest_keyboard_key(keyboard, KEY_A, false); - litest_assert_only_typed_events(li, LIBINPUT_EVENT_KEYBOARD_KEY); litest_touch_down(touchpad, 0, 50, 50); + + litest_keyboard_key(keyboard, KEY_A, true); + litest_keyboard_key(keyboard, KEY_A, false); + litest_assert_only_typed_events(li, LIBINPUT_EVENT_KEYBOARD_KEY); + litest_touch_move_to(touchpad, 0, 50, 50, 70, 50, 10, 1); litest_assert_empty_queue(li); + litest_timeout_dwt_long(); + libinput_dispatch(li); + disable_dwt(touchpad); /* touch already down -> keeps being ignored */