test: use litest_assert_empty_queue instead of a manual none check
authorPeter Hutterer <peter.hutterer@who-t.net>
Wed, 18 Sep 2024 04:57:51 +0000 (14:57 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Thu, 19 Sep 2024 13:41:23 +0000 (23:41 +1000)
This provides better debugging printfs and is the now-recommended way to
check this.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1050>

test/test-touchpad-buttons.c

index a8122803850943e2f2577c94ea7ab3e33a590344..4aea7574f066c2db3b4544abb356464662a21459 100644 (file)
@@ -1191,8 +1191,7 @@ START_TEST(clickpad_btn_left)
        litest_event(dev, EV_KEY, BTN_LEFT, 0);
        litest_event(dev, EV_SYN, SYN_REPORT, 0);
 
-       litest_dispatch(li);
-       ck_assert_int_eq(libinput_next_event_type(li), LIBINPUT_EVENT_NONE);
+       litest_assert_empty_queue(li);
 }
 END_TEST
 
@@ -1211,8 +1210,7 @@ START_TEST(clickpad_click_n_drag)
        litest_assert_button_event(li, BTN_LEFT,
                                   LIBINPUT_BUTTON_STATE_PRESSED);
 
-       litest_dispatch(li);
-       ck_assert_int_eq(libinput_next_event_type(li), LIBINPUT_EVENT_NONE);
+       litest_assert_empty_queue(li);
 
        /* now put a second finger down */
        litest_touch_down(dev, 1, 70, 70);