From 6f447cb8de7a6ef151fd2bfa41c2701c986bc9a4 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 17 Nov 2017 10:01:05 +1000 Subject: [PATCH] test: use litest_wait_for_event() for the lid switch events Getting spurious test case failures in these two tests but they're not easily reproducible. One cause may be a slight delay of the event that we're writing to the kernel device. If that has a minor delay, we'll miss it. Signed-off-by: Peter Hutterer --- test/test-switch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test-switch.c b/test/test-switch.c index 12488cbb..65cf1ecc 100644 --- a/test/test-switch.c +++ b/test/test-switch.c @@ -691,7 +691,7 @@ START_TEST(lid_update_hw_on_key) litest_event(keyboard, EV_SYN, SYN_REPORT, 0); litest_drain_events(li); - libinput_dispatch(li2); + litest_wait_for_event(li2); event = libinput_get_event(li2); litest_is_switch_event(event, LIBINPUT_SWITCH_LID, @@ -798,7 +798,7 @@ START_TEST(lid_update_hw_on_key_multiple_keyboards) litest_event(keyboard2, EV_SYN, SYN_REPORT, 0); litest_drain_events(li); - libinput_dispatch(li2); + litest_wait_for_event(li2); event = libinput_get_event(li2); litest_is_switch_event(event, LIBINPUT_SWITCH_LID,