[PATCH libinput 2/4] test: restore log priority after each test
Peter Hutterer
peter.hutterer at who-t.net
Thu May 22 21:37:14 PDT 2014
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
test/log.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/test/log.c b/test/log.c
index 0c5508f..b8cc767 100644
--- a/test/log.c
+++ b/test/log.c
@@ -74,6 +74,7 @@ END_TEST
START_TEST(log_handler_invoked)
{
struct libinput *li;
+ enum libinput_log_priority pri = libinput_log_get_priority();
libinput_log_set_priority(LIBINPUT_LOG_PRIORITY_DEBUG);
libinput_log_set_handler(simple_log_handler, NULL);
@@ -86,12 +87,14 @@ START_TEST(log_handler_invoked)
log_handler_called = 0;
libinput_destroy(li);
+ libinput_log_set_priority(pri);
}
END_TEST
START_TEST(log_userdata_NULL)
{
struct libinput *li;
+ enum libinput_log_priority pri = libinput_log_get_priority();
libinput_log_set_priority(LIBINPUT_LOG_PRIORITY_DEBUG);
libinput_log_set_handler(simple_log_handler, NULL);
@@ -104,12 +107,16 @@ START_TEST(log_userdata_NULL)
log_handler_called = 0;
libinput_destroy(li);
+
+ libinput_log_set_priority(pri);
+ libinput_log_set_priority(pri);
}
END_TEST
START_TEST(log_userdata)
{
struct libinput *li;
+ enum libinput_log_priority pri = libinput_log_get_priority();
libinput_log_set_priority(LIBINPUT_LOG_PRIORITY_DEBUG);
libinput_log_set_handler(simple_log_handler, &li);
@@ -122,12 +129,14 @@ START_TEST(log_userdata)
log_handler_called = 0;
libinput_destroy(li);
+ libinput_log_set_priority(pri);
}
END_TEST
START_TEST(log_handler_NULL)
{
struct libinput *li;
+ enum libinput_log_priority pri = libinput_log_get_priority();
libinput_log_set_priority(LIBINPUT_LOG_PRIORITY_DEBUG);
libinput_log_set_handler(NULL, NULL);
@@ -141,12 +150,14 @@ START_TEST(log_handler_NULL)
libinput_log_set_handler(simple_log_handler, NULL);
libinput_destroy(li);
+ libinput_log_set_priority(pri);
}
END_TEST
START_TEST(log_priority)
{
struct libinput *li;
+ enum libinput_log_priority pri = libinput_log_get_priority();
libinput_log_set_priority(LIBINPUT_LOG_PRIORITY_ERROR);
libinput_log_set_handler(simple_log_handler, NULL);
@@ -164,6 +175,7 @@ START_TEST(log_priority)
log_handler_called = 0;
libinput_destroy(li);
+ libinput_log_set_priority(pri);
}
END_TEST
--
1.9.0
More information about the wayland-devel
mailing list