From 74f4491f174985498e86737640fee3ad4f09437a Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 27 Aug 2018 16:31:12 +1000 Subject: [PATCH] test: fix pad_button_ignored test to not trigger the proximity timeout Once we start working with real event frames (i.e. intervals after SYN_REPORT) we'll always trigger the proximity timeout here. Avoid this by sending one event with all buttons. Signed-off-by: Peter Hutterer --- test/test-tablet.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/test/test-tablet.c b/test/test-tablet.c index e6d5156a..45375113 100644 --- a/test/test-tablet.c +++ b/test/test-tablet.c @@ -2226,13 +2226,17 @@ START_TEST(pad_buttons_ignored) litest_tablet_proximity_in(dev, 10, 10, axes); litest_drain_events(li); - for (button = BTN_0; button < BTN_MOUSE; button++) { + for (button = BTN_0; button < BTN_MOUSE; button++) litest_event(dev, EV_KEY, button, 1); - litest_event(dev, EV_SYN, SYN_REPORT, 0); + + litest_event(dev, EV_SYN, SYN_REPORT, 0); + libinput_dispatch(li); + + for (button = BTN_0; button < BTN_MOUSE; button++) litest_event(dev, EV_KEY, button, 0); - litest_event(dev, EV_SYN, SYN_REPORT, 0); - libinput_dispatch(li); - } + + litest_event(dev, EV_SYN, SYN_REPORT, 0); + libinput_dispatch(li); litest_assert_empty_queue(li); }