unit-tests: Print error when configuring context

More helpful than an assert.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1993>
This commit is contained in:
Jonas Ådahl 2021-09-07 10:32:08 +02:00 committed by Marge Bot
parent d8521ffc56
commit a1d5c96e86

View File

@ -239,10 +239,12 @@ int
main (int argc, char *argv[]) main (int argc, char *argv[])
{ {
g_autoptr (MetaContext) context = NULL; g_autoptr (MetaContext) context = NULL;
g_autoptr (GError) error = NULL;
context = meta_create_test_context (META_CONTEXT_TEST_TYPE_NESTED, context = meta_create_test_context (META_CONTEXT_TEST_TYPE_NESTED,
META_CONTEXT_TEST_FLAG_TEST_CLIENT); 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; test_context = context;