test: release a few leaking udev devices

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2018-07-26 10:25:52 +10:00
parent d693eef563
commit 5f589c8582
2 changed files with 6 additions and 2 deletions

View file

@ -1562,6 +1562,7 @@ litest_add_device_with_overrides(struct libinput *libinput,
const struct input_absinfo *abs_override,
const int *events_override)
{
struct udev_device *ud;
struct litest_device *d;
const char *path;
@ -1576,8 +1577,9 @@ litest_add_device_with_overrides(struct libinput *libinput,
d->libinput = libinput;
d->libinput_device = libinput_path_add_device(d->libinput, path);
d->quirks = quirks_fetch_for_device(quirks_context,
libinput_device_get_udev_device(d->libinput_device));
ud = libinput_device_get_udev_device(d->libinput_device);
d->quirks = quirks_fetch_for_device(quirks_context, ud);
udev_device_unref(ud);
litest_assert(d->libinput_device != NULL);
libinput_device_ref(d->libinput_device);

View file

@ -859,6 +859,7 @@ START_TEST(quirks_model_one)
quirks_unref(q);
quirks_context_unref(ctx);
cleanup_data_dir(dd);
udev_device_unref(ud);
}
END_TEST
@ -891,6 +892,7 @@ START_TEST(quirks_model_zero)
quirks_unref(q);
quirks_context_unref(ctx);
cleanup_data_dir(dd);
udev_device_unref(ud);
}
END_TEST