From a1d5c96e86f672c2252b95d1e4765f2931f582b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Tue, 7 Sep 2021 10:32:08 +0200 Subject: [PATCH] unit-tests: Print error when configuring context More helpful than an assert. Part-of: --- src/tests/unit-tests.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tests/unit-tests.c b/src/tests/unit-tests.c index 0dba16535..dfad2bdc7 100644 --- a/src/tests/unit-tests.c +++ b/src/tests/unit-tests.c @@ -239,10 +239,12 @@ int main (int argc, char *argv[]) { g_autoptr (MetaContext) context = NULL; + g_autoptr (GError) error = NULL; context = meta_create_test_context (META_CONTEXT_TEST_TYPE_NESTED, META_CONTEXT_TEST_FLAG_TEST_CLIENT); - g_assert (meta_context_configure (context, &argc, &argv, NULL)); + if (!meta_context_configure (context, &argc, &argv, &error)) + g_error ("Failed to configure test context: %s", error->message); test_context = context;