mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-20 13:50:15 +01:00
test: plug a couple of memory leaks
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
e49a9888bf
commit
2001443100
2 changed files with 15 additions and 1 deletions
10
test/log.c
10
test/log.c
|
|
@ -84,6 +84,8 @@ START_TEST(log_handler_invoked)
|
|||
|
||||
ck_assert_int_gt(log_handler_called, 0);
|
||||
log_handler_called = 0;
|
||||
|
||||
libinput_destroy(li);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
|
|
@ -100,6 +102,8 @@ START_TEST(log_userdata_NULL)
|
|||
|
||||
ck_assert_int_gt(log_handler_called, 0);
|
||||
log_handler_called = 0;
|
||||
|
||||
libinput_destroy(li);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
|
|
@ -116,6 +120,8 @@ START_TEST(log_userdata)
|
|||
|
||||
ck_assert_int_gt(log_handler_called, 0);
|
||||
log_handler_called = 0;
|
||||
|
||||
libinput_destroy(li);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
|
|
@ -133,6 +139,8 @@ START_TEST(log_handler_NULL)
|
|||
ck_assert_int_eq(log_handler_called, 0);
|
||||
log_handler_called = 0;
|
||||
libinput_log_set_handler(simple_log_handler, NULL);
|
||||
|
||||
libinput_destroy(li);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
|
|
@ -154,6 +162,8 @@ START_TEST(log_priority)
|
|||
ck_assert_int_gt(log_handler_called, 0);
|
||||
|
||||
log_handler_called = 0;
|
||||
|
||||
libinput_destroy(li);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
|
|
|
|||
|
|
@ -76,8 +76,10 @@ START_TEST(touch_abs_transform)
|
|||
libinput_dispatch(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;
|
||||
}
|
||||
|
||||
tev = libinput_event_get_touch_event(ev);
|
||||
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);
|
||||
|
||||
tested = true;
|
||||
|
||||
libinput_event_destroy(ev);
|
||||
}
|
||||
|
||||
ck_assert(tested);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue