diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2021-10-19 13:01:23 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2021-10-19 13:05:00 +1000 |
commit | e2d4e0552ab5b8dc39dcb4fae9808ba643c2ba1a (patch) | |
tree | e16d2b268eabb456c2758125d885a1d32f51b5bb | |
parent | 9b77661e028523626cd85a057b7e9f5efd2d21be (diff) | |
download | libinput-e2d4e0552ab5b8dc39dcb4fae9808ba643c2ba1a.tar.gz |
test: use a plain libinput context for the log priority check
Don't use the litest wrapper context here, it changes log priority if
the test suite is run with --verbose, causing the test to fail.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r-- | test/test-log.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/test/test-log.c b/test/test-log.c index 346955e1..0f344f5b 100644 --- a/test/test-log.c +++ b/test/test-log.c @@ -47,17 +47,34 @@ simple_log_handler(struct libinput *libinput, litest_assert_notnull(format); } + +static int open_restricted(const char *path, int flags, void *data) +{ + int fd; + fd = open(path, flags); + return fd < 0 ? -errno : fd; +} +static void close_restricted(int fd, void *data) +{ + close(fd); +} + +static const struct libinput_interface simple_interface = { + .open_restricted = open_restricted, + .close_restricted = close_restricted, +}; + START_TEST(log_default_priority) { enum libinput_log_priority pri; struct libinput *li; - li = litest_create_context(); + li = libinput_path_create_context(&simple_interface, NULL); pri = libinput_log_get_priority(li); ck_assert_int_eq(pri, LIBINPUT_LOG_PRIORITY_ERROR); - litest_destroy_context(li); + libinput_unref(li); } END_TEST |