From d0aa30a43505ce0f45624d9863ec0280a0eb473e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Thu, 2 Sep 2021 15:04:06 +0200 Subject: [PATCH] tod: Check the message emission if the tod path isn't readable --- tests/test-fp-context-tod.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/test-fp-context-tod.c b/tests/test-fp-context-tod.c index f25a31dc..7137e3dd 100644 --- a/tests/test-fp-context-tod.c +++ b/tests/test-fp-context-tod.c @@ -17,6 +17,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#define FP_COMPONENT "tod" + +#include "fpi-log.h" #include static void @@ -33,8 +36,12 @@ test_context_has_no_devices (void) GPtrArray *devices; const char *old_drivers_dir = g_getenv ("FP_TOD_DRIVERS_DIR"); + g_test_expect_message (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, + "*Impossible to load the shared drivers dir Error " + "opening directory*__HOPEFULLY_AN_INVALID_PATH*"); g_setenv ("FP_TOD_DRIVERS_DIR", "__HOPEFULLY_AN_INVALID_PATH", TRUE); context = fp_context_new (); + g_test_assert_expected_messages (); devices = fp_context_get_devices (context); g_setenv ("FP_TOD_DRIVERS_DIR", old_drivers_dir, TRUE);