summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-04-10 14:58:03 +0200
committerThomas Haller <thaller@redhat.com>2015-04-10 18:30:24 +0200
commit636c8592ced4fb09f3028307de342853a46e8eab (patch)
tree2185edf2fbd8ee4d9474bec96eb29521c096c261
parentfd10ed1e71b294ce16cf61bbdee56c8d8ee49662 (diff)
downloadNetworkManager-636c8592ced4fb09f3028307de342853a46e8eab.tar.gz
test: fix compiler warning in g_test_assert_expected_messages_internal()
-Wformat of gcc determines that the string arguments are NULL. Fixes: 373d09b0425c6dfb699ee4b6615ded0177d0e344 (cherry picked from commit 0aca44c857d8d949b272baacbfbaef08d16618d4)
-rw-r--r--include/nm-test-utils.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/nm-test-utils.h b/include/nm-test-utils.h
index c529de7ac6..f615c6b1b7 100644
--- a/include/nm-test-utils.h
+++ b/include/nm-test-utils.h
@@ -445,12 +445,17 @@ nmtst_is_debug (void)
#undef g_test_assert_expected_messages_internal
#define g_test_assert_expected_messages_internal(domain, file, line, func) \
G_STMT_START { \
+ const char *_domain = (domain); \
+ const char *_file = (file); \
+ const char *_func = (func); \
+ int _line = (line); \
+ \
g_assert (nmtst_initialized ()); \
if (__nmtst_internal.assert_logging && __nmtst_internal.no_expect_message) \
- g_debug ("nmtst: assert-logging: g_test_assert_expected_messages(%s, %s:%d, %s)", domain, file, line, func); \
+ g_debug ("nmtst: assert-logging: g_test_assert_expected_messages(%s, %s:%d, %s)", _domain?:"", _file?:"", _line, _func?:""); \
\
G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
- g_test_assert_expected_messages_internal (domain, file, line, func); \
+ g_test_assert_expected_messages_internal (_domain, _file, _line, _func); \
G_GNUC_END_IGNORE_DEPRECATIONS \
} G_STMT_END
#endif