test: use litest_wait_for_event instead of a NONE event check

Technically we're not really waiting here since we expect the
event to already be there but for these tests the distinction doesn't
matter.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1050>
This commit is contained in:
Peter Hutterer 2024-09-18 18:28:26 +10:00
parent 24d9b46b43
commit 011c1474d3
2 changed files with 2 additions and 4 deletions

View file

@ -687,8 +687,7 @@ START_TEST(touch_protocol_a_init)
struct libinput *li = dev->libinput;
struct libinput_device *device = dev->libinput_device;
ck_assert_int_ne(libinput_next_event_type(li),
LIBINPUT_EVENT_NONE);
litest_wait_for_event(li);
ck_assert(libinput_device_has_capability(device,
LIBINPUT_DEVICE_CAP_TOUCH));

View file

@ -2859,8 +2859,7 @@ START_TEST(touchpad_semi_mt_hover_down)
litest_dispatch(li);
ck_assert_int_ne(libinput_next_event_type(li),
LIBINPUT_EVENT_NONE);
litest_wait_for_event(li);
while ((event = libinput_get_event(li)) != NULL) {
ck_assert_int_eq(libinput_event_get_type(event),
LIBINPUT_EVENT_POINTER_MOTION);