diff --git a/include/nm-test-utils.h b/include/nm-test-utils.h index 258d39370b..2cec325bbe 100644 --- a/include/nm-test-utils.h +++ b/include/nm-test-utils.h @@ -275,17 +275,6 @@ __nmtst_init (int *argc, char ***argv, gboolean assert_logging, const char *log_ if (argc) __nmtst_internal.orig_argv = g_strdupv (*argv); - if (argc && !g_test_initialized ()) { - /* g_test_init() is a variadic function, so we cannot pass it - * (variadic) arguments. If you need to pass additional parameters, - * call nmtst_init() with argc==NULL and call g_test_init() yourself. */ - - /* g_test_init() sets g_log_set_always_fatal() for G_LOG_LEVEL_WARNING - * and G_LOG_LEVEL_CRITICAL. So, beware that the test will fail if you - * have any WARN or ERR log messages -- unless you g_test_expect_message(). */ - g_test_init (argc, argv, NULL); - } - __nmtst_internal.assert_logging = !!assert_logging; #if !GLIB_CHECK_VERSION (2, 35, 0) @@ -361,6 +350,17 @@ __nmtst_init (int *argc, char ***argv, gboolean assert_logging, const char *log_ } } + if (argc && !g_test_initialized ()) { + /* g_test_init() is a variadic function, so we cannot pass it + * (variadic) arguments. If you need to pass additional parameters, + * call nmtst_init() with argc==NULL and call g_test_init() yourself. */ + + /* g_test_init() sets g_log_set_always_fatal() for G_LOG_LEVEL_WARNING + * and G_LOG_LEVEL_CRITICAL. So, beware that the test will fail if you + * have any WARN or ERR log messages -- unless you g_test_expect_message(). */ + g_test_init (argc, argv, NULL); + } + if (test_quick_set) __nmtst_internal.test_quick = test_quick; else if (test_quick_argv)