test: plug a couple of memory leaks

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2014-03-27 08:43:04 +10:00
parent e49a9888bf
commit 2001443100
2 changed files with 15 additions and 1 deletions

View file

@ -84,6 +84,8 @@ START_TEST(log_handler_invoked)
ck_assert_int_gt(log_handler_called, 0); ck_assert_int_gt(log_handler_called, 0);
log_handler_called = 0; log_handler_called = 0;
libinput_destroy(li);
} }
END_TEST END_TEST
@ -100,6 +102,8 @@ START_TEST(log_userdata_NULL)
ck_assert_int_gt(log_handler_called, 0); ck_assert_int_gt(log_handler_called, 0);
log_handler_called = 0; log_handler_called = 0;
libinput_destroy(li);
} }
END_TEST END_TEST
@ -116,6 +120,8 @@ START_TEST(log_userdata)
ck_assert_int_gt(log_handler_called, 0); ck_assert_int_gt(log_handler_called, 0);
log_handler_called = 0; log_handler_called = 0;
libinput_destroy(li);
} }
END_TEST END_TEST
@ -133,6 +139,8 @@ START_TEST(log_handler_NULL)
ck_assert_int_eq(log_handler_called, 0); ck_assert_int_eq(log_handler_called, 0);
log_handler_called = 0; log_handler_called = 0;
libinput_log_set_handler(simple_log_handler, NULL); libinput_log_set_handler(simple_log_handler, NULL);
libinput_destroy(li);
} }
END_TEST END_TEST
@ -154,6 +162,8 @@ START_TEST(log_priority)
ck_assert_int_gt(log_handler_called, 0); ck_assert_int_gt(log_handler_called, 0);
log_handler_called = 0; log_handler_called = 0;
libinput_destroy(li);
} }
END_TEST END_TEST

View file

@ -76,8 +76,10 @@ START_TEST(touch_abs_transform)
libinput_dispatch(libinput); libinput_dispatch(libinput);
while ((ev = libinput_get_event(libinput))) { while ((ev = libinput_get_event(libinput))) {
if (libinput_event_get_type(ev) != LIBINPUT_EVENT_TOUCH_DOWN) if (libinput_event_get_type(ev) != LIBINPUT_EVENT_TOUCH_DOWN) {
libinput_event_destroy(ev);
continue; continue;
}
tev = libinput_event_get_touch_event(ev); tev = libinput_event_get_touch_event(ev);
fx = libinput_event_touch_get_x_transformed(tev, 1920); fx = libinput_event_touch_get_x_transformed(tev, 1920);
@ -86,6 +88,8 @@ START_TEST(touch_abs_transform)
ck_assert_int_eq(li_fixed_to_int(fy), 719); ck_assert_int_eq(li_fixed_to_int(fy), 719);
tested = true; tested = true;
libinput_event_destroy(ev);
} }
ck_assert(tested); ck_assert(tested);