test: fix a couple of memleaks in the tests

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2014-04-23 11:04:48 +10:00
parent e47f88bc48
commit 54431242ce
3 changed files with 13 additions and 0 deletions

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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);
}