mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-26 11:00:06 +01:00
test: remove some untriggered code from the keyboard tests
The second condition was never triggered because we shouldn't get anything but keyboard events here. Drain the initial event burst and remove the two skipping conditions that won't happen anyway. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
5dcb949c3d
commit
a9016f7e15
1 changed files with 2 additions and 14 deletions
|
|
@ -50,18 +50,13 @@ START_TEST(keyboard_seat_key_count)
|
|||
NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
litest_drain_events(libinput);
|
||||
|
||||
for (i = 0; i < num_devices; ++i)
|
||||
litest_keyboard_key(devices[i], KEY_A, true);
|
||||
|
||||
libinput_dispatch(libinput);
|
||||
while ((ev = libinput_get_event(libinput))) {
|
||||
if (libinput_event_get_type(ev) !=
|
||||
LIBINPUT_EVENT_KEYBOARD_KEY) {
|
||||
libinput_event_destroy(ev);
|
||||
libinput_dispatch(libinput);
|
||||
continue;
|
||||
}
|
||||
|
||||
kev = litest_is_keyboard_event(ev,
|
||||
KEY_A,
|
||||
LIBINPUT_KEY_STATE_PRESSED);
|
||||
|
|
@ -82,13 +77,6 @@ START_TEST(keyboard_seat_key_count)
|
|||
|
||||
libinput_dispatch(libinput);
|
||||
while ((ev = libinput_get_event(libinput))) {
|
||||
if (libinput_event_get_type(ev) !=
|
||||
LIBINPUT_EVENT_KEYBOARD_KEY) {
|
||||
libinput_event_destroy(ev);
|
||||
libinput_dispatch(libinput);
|
||||
continue;
|
||||
}
|
||||
|
||||
kev = libinput_event_get_keyboard_event(ev);
|
||||
ck_assert_notnull(kev);
|
||||
ck_assert_int_eq(libinput_event_keyboard_get_key(kev), KEY_A);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue