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 15:06:23 +0200
commit0aca44c857d8d949b272baacbfbaef08d16618d4 (patch)
treec93f6b29401c8857dcf36368a289ea74afa49808
parent7c5d361c6632236ac3eb6b929d42cd8854aba922 (diff)
downloadNetworkManager-0aca44c857d8d949b272baacbfbaef08d16618d4.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
-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 ca244bdf41..2349214e21 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