summaryrefslogtreecommitdiff
path: root/test/test-switch.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2017-11-17 10:01:05 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2017-11-17 10:01:05 +1000
commit6f447cb8de7a6ef151fd2bfa41c2701c986bc9a4 (patch)
tree12875ef6a1a6af343bbdb197e6f88a2923b911ee /test/test-switch.c
parentfca003d305ea83f8f09f0bd0dbfc54ece4d2cc04 (diff)
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 <peter.hutterer@who-t.net>
Diffstat (limited to 'test/test-switch.c')
-rw-r--r--test/test-switch.c4
1 files 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,