From c3aafd9dabac1ead75e6199cdd83e3da5e431e78 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 23 Nov 2015 17:40:44 +0100 Subject: [PATCH] nmtst: initialize g_test_init() after parsing NMTST_DEBUG (cherry picked from commit 5031fc3c7163b254697f2c0a74b8a750de5fe7a8) --- include/nm-test-utils.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) 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)