Commit 258ba1c3 authored by Peter Hutterer's avatar Peter Hutterer

test: if no teardown func is set, use the default

Reduces the amount of boilerplate code.
Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
parent 04d52d71
......@@ -131,6 +131,5 @@ struct litest_test_device litest_bcm5974_device = {
.features = LITEST_TOUCHPAD | LITEST_CLICKPAD | LITEST_BUTTON,
.shortname = "bcm5974",
.setup = litest_bcm5974_setup,
.teardown = litest_generic_device_teardown,
.create = litest_create_bcm5974,
};
......@@ -123,6 +123,5 @@ struct litest_test_device litest_generic_highres_touch_device = {
.features = LITEST_TOUCH,
.shortname = "generic-highres-touch",
.setup = litest_generic_highres_touch_setup,
.teardown = litest_generic_device_teardown,
.create = litest_create_generic_highres_touch,
};
......@@ -109,6 +109,5 @@ struct litest_test_device litest_keyboard_device = {
.features = LITEST_KEYS,
.shortname = "default keyboard",
.setup = litest_keyboard_setup,
.teardown = litest_generic_device_teardown,
.create = litest_create_keyboard,
};
......@@ -70,6 +70,5 @@ struct litest_test_device litest_mouse_device = {
.features = LITEST_POINTER | LITEST_BUTTON | LITEST_WHEEL,
.shortname = "mouse",
.setup = litest_mouse_setup,
.teardown = litest_generic_device_teardown,
.create = litest_create_mouse,
};
......@@ -126,6 +126,5 @@ struct litest_test_device litest_synaptics_touchpad_device = {
.features = LITEST_TOUCHPAD | LITEST_BUTTON | LITEST_SINGLE_TOUCH,
.shortname = "synaptics ST",
.setup = litest_synaptics_touchpad_setup,
.teardown = litest_generic_device_teardown,
.create = litest_create_synaptics_touchpad,
};
......@@ -61,6 +61,5 @@ struct litest_test_device litest_trackpoint_device = {
.features = LITEST_POINTER | LITEST_BUTTON,
.shortname = "trackpoint",
.setup = litest_trackpoint_setup,
.teardown = litest_generic_device_teardown,
.create = litest_create_trackpoint,
};
......@@ -122,6 +122,5 @@ struct litest_test_device litest_wacom_touch_device = {
.features = LITEST_TOUCH,
.shortname = "wacom-touch",
.setup = litest_wacom_touch_setup,
.teardown = litest_generic_device_teardown,
.create = litest_create_wacom_touch,
};
......@@ -119,7 +119,8 @@ litest_add_tcase_for_device(struct suite *suite,
t->name = strdup(test_name);
t->tc = tcase_create(test_name);
list_insert(&suite->tests, &t->node);
tcase_add_checked_fixture(t->tc, dev->setup, dev->teardown);
tcase_add_checked_fixture(t->tc, dev->setup,
dev->teardown ? dev->teardown : litest_generic_device_teardown);
tcase_add_test(t->tc, func);
suite_add_tcase(suite->suite, t->tc);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment