summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Ådahl <jadahl@gmail.com>2014-07-16 21:14:51 +0200
committerJonas Ådahl <jadahl@gmail.com>2014-07-22 20:36:37 +0200
commitea1d2d6348e791ef2d1a07c8a7567eb850334f44 (patch)
treea704f9d95b738a31563a3f1fba452df120a81c7a
parent125e98a1f8909cafbb968ea0c2bd9b21349490bb (diff)
downloadlibinput-ea1d2d6348e791ef2d1a07c8a7567eb850334f44.tar.gz
test/path: Avoid creating ignored test devices
Some tests doesn't use or doesn't need to use the test device automatically created when adding a test case for certain types of devices. For these tests, to shorten test run time, don't create the test devices that would be ignored. Signed-off-by: Jonas Ådahl <jadahl@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--test/path.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/test/path.c b/test/path.c
index b5e222dd..475e125f 100644
--- a/test/path.c
+++ b/test/path.c
@@ -243,12 +243,11 @@ END_TEST
START_TEST(path_add_invalid_path)
{
- struct litest_device *dev = litest_current_device();
- struct libinput *li = dev->libinput;
+ struct libinput *li;
struct libinput_event *event;
struct libinput_device *device;
- litest_drain_events(li);
+ li = litest_create_context();
device = libinput_path_add_device(li, "/tmp/");
ck_assert(device == NULL);
@@ -257,6 +256,8 @@ START_TEST(path_add_invalid_path)
while ((event = libinput_get_event(li)))
ck_abort();
+
+ libinput_unref(li);
}
END_TEST
@@ -794,24 +795,23 @@ END_TEST
int main (int argc, char **argv) {
- litest_add("path:create", path_create_NULL, LITEST_ANY, LITEST_ANY);
- litest_add("path:create", path_create_invalid, LITEST_ANY, LITEST_ANY);
- litest_add("path:create", path_create_destroy, LITEST_ANY, LITEST_ANY);
- litest_add("path:suspend", path_suspend, LITEST_ANY, LITEST_ANY);
- litest_add("path:suspend", path_double_suspend, LITEST_ANY, LITEST_ANY);
- litest_add("path:suspend", path_double_resume, LITEST_ANY, LITEST_ANY);
- litest_add("path:suspend", path_add_device_suspend_resume, LITEST_ANY, LITEST_ANY);
- litest_add("path:suspend", path_add_device_suspend_resume_fail, LITEST_ANY, LITEST_ANY);
- litest_add("path:suspend", path_add_device_suspend_resume_remove_device, LITEST_ANY, LITEST_ANY);
+ litest_add_no_device("path:create", path_create_NULL);
+ litest_add_no_device("path:create", path_create_invalid);
+ litest_add_no_device("path:create", path_create_destroy);
+ litest_add_no_device("path:suspend", path_suspend);
+ litest_add_no_device("path:suspend", path_double_suspend);
+ litest_add_no_device("path:suspend", path_double_resume);
+ litest_add_no_device("path:suspend", path_add_device_suspend_resume);
+ litest_add_no_device("path:suspend", path_add_device_suspend_resume_fail);
+ litest_add_no_device("path:suspend", path_add_device_suspend_resume_remove_device);
litest_add("path:seat events", path_added_seat, LITEST_ANY, LITEST_ANY);
litest_add("path:device events", path_added_device, LITEST_ANY, LITEST_ANY);
litest_add("path:device events", path_device_sysname, LITEST_ANY, LITEST_ANY);
litest_add("path:device events", path_add_device, LITEST_ANY, LITEST_ANY);
- litest_add("path:device events", path_add_invalid_path, LITEST_ANY, LITEST_ANY);
+ litest_add_no_device("path:device events", path_add_invalid_path);
litest_add("path:device events", path_remove_device, LITEST_ANY, LITEST_ANY);
litest_add("path:device events", path_double_remove_device, LITEST_ANY, LITEST_ANY);
- litest_add("path:seat", path_seat_recycle,
- LITEST_DISABLE_DEVICE, LITEST_DISABLE_DEVICE);
+ litest_add_no_device("path:seat", path_seat_recycle);
return litest_run(argc, argv);
}