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>
This commit is contained in:
Peter Hutterer 2017-11-17 10:01:05 +10:00
parent fca003d305
commit 6f447cb8de

View file

@ -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,