test: use litest_wait_for_event instead of a NONE event check
authorPeter Hutterer <peter.hutterer@who-t.net>
Wed, 18 Sep 2024 08:28:26 +0000 (18:28 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Thu, 19 Sep 2024 13:41:24 +0000 (23:41 +1000)
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>

test/test-touch.c
test/test-touchpad.c

index 3973f8d702658504ba47de88f22d8b89eb4d2eb4..42da25921cdf03243e4c57a7f2c51fe16f3c0932 100644 (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));
index 3b25391514a01f90de3b706248df56d5fbba4edd..b2a4ae4185bb9cf02163f393e36d36c5f1264918 100644 (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);