mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-05-05 02:58:08 +02:00
test: fix a couple of memleaks in the tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
e47f88bc48
commit
54431242ce
3 changed files with 13 additions and 0 deletions
|
|
@ -55,6 +55,7 @@ START_TEST(keyboard_seat_key_count)
|
|||
while ((ev = libinput_get_event(libinput))) {
|
||||
if (libinput_event_get_type(ev) !=
|
||||
LIBINPUT_EVENT_KEYBOARD_KEY) {
|
||||
libinput_event_destroy(ev);
|
||||
libinput_dispatch(libinput);
|
||||
continue;
|
||||
}
|
||||
|
|
@ -70,6 +71,7 @@ START_TEST(keyboard_seat_key_count)
|
|||
libinput_event_keyboard_get_seat_key_count(kev);
|
||||
ck_assert_int_eq(expected_key_button_count, seat_key_count);
|
||||
|
||||
libinput_event_destroy(ev);
|
||||
libinput_dispatch(libinput);
|
||||
}
|
||||
|
||||
|
|
@ -82,6 +84,7 @@ START_TEST(keyboard_seat_key_count)
|
|||
while ((ev = libinput_get_event(libinput))) {
|
||||
if (libinput_event_get_type(ev) !=
|
||||
LIBINPUT_EVENT_KEYBOARD_KEY) {
|
||||
libinput_event_destroy(ev);
|
||||
libinput_dispatch(libinput);
|
||||
continue;
|
||||
}
|
||||
|
|
@ -97,6 +100,7 @@ START_TEST(keyboard_seat_key_count)
|
|||
libinput_event_keyboard_get_seat_key_count(kev);
|
||||
ck_assert_int_eq(expected_key_button_count, seat_key_count);
|
||||
|
||||
libinput_event_destroy(ev);
|
||||
libinput_dispatch(libinput);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -212,6 +212,7 @@ START_TEST(pointer_seat_button_count)
|
|||
while ((ev = libinput_get_event(libinput))) {
|
||||
if (libinput_event_get_type(ev) !=
|
||||
LIBINPUT_EVENT_POINTER_BUTTON) {
|
||||
libinput_event_destroy(ev);
|
||||
libinput_dispatch(libinput);
|
||||
continue;
|
||||
}
|
||||
|
|
@ -228,6 +229,7 @@ START_TEST(pointer_seat_button_count)
|
|||
libinput_event_pointer_get_seat_button_count(tev);
|
||||
ck_assert_int_eq(expected_seat_button_count, seat_button_count);
|
||||
|
||||
libinput_event_destroy(ev);
|
||||
libinput_dispatch(libinput);
|
||||
}
|
||||
|
||||
|
|
@ -240,6 +242,7 @@ START_TEST(pointer_seat_button_count)
|
|||
while ((ev = libinput_get_event(libinput))) {
|
||||
if (libinput_event_get_type(ev) !=
|
||||
LIBINPUT_EVENT_POINTER_BUTTON) {
|
||||
libinput_event_destroy(ev);
|
||||
libinput_dispatch(libinput);
|
||||
continue;
|
||||
}
|
||||
|
|
@ -256,6 +259,7 @@ START_TEST(pointer_seat_button_count)
|
|||
libinput_event_pointer_get_seat_button_count(tev);
|
||||
ck_assert_int_eq(expected_seat_button_count, seat_button_count);
|
||||
|
||||
libinput_event_destroy(ev);
|
||||
libinput_dispatch(libinput);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -147,6 +147,7 @@ START_TEST(touch_many_slots)
|
|||
else if (type == LIBINPUT_EVENT_TOUCH_UP)
|
||||
break;
|
||||
|
||||
libinput_event_destroy(ev);
|
||||
libinput_dispatch(libinput);
|
||||
}
|
||||
|
||||
|
|
@ -160,10 +161,13 @@ START_TEST(touch_many_slots)
|
|||
if (type == LIBINPUT_EVENT_TOUCH_UP)
|
||||
slot_count--;
|
||||
|
||||
libinput_event_destroy(ev);
|
||||
libinput_dispatch(libinput);
|
||||
} while ((ev = libinput_get_event(libinput)));
|
||||
|
||||
ck_assert_int_eq(slot_count, 0);
|
||||
|
||||
litest_delete_device(dev);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
|
|
@ -200,6 +204,7 @@ START_TEST(touch_double_touch_down_up)
|
|||
break;
|
||||
}
|
||||
|
||||
libinput_event_destroy(ev);
|
||||
libinput_dispatch(libinput);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue