summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-03-13 14:39:16 +0100
committerThomas Haller <thaller@redhat.com>2015-03-20 13:19:15 +0100
commit94cc7ca4f8f9cc97f4ff03a1fc7f6fa414da6038 (patch)
tree7aca6ded6fcbf487146f65b0bc2d4999bae7a377
parent3ef2a5364b1494230f2135f8b642d3a0fd2b2f30 (diff)
downloadNetworkManager-94cc7ca4f8f9cc97f4ff03a1fc7f6fa414da6038.tar.gz
test: fix __NMTST_LOG() macro to allow format-string-only argument
We want to be able to call __NMTST_LOG(g_message, "hallo"); without additional format string arguments.
-rw-r--r--include/nm-test-utils.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/nm-test-utils.h b/include/nm-test-utils.h
index 187a0f1931..4a07ecdf49 100644
--- a/include/nm-test-utils.h
+++ b/include/nm-test-utils.h
@@ -32,6 +32,7 @@
#include <errno.h>
#include "nm-utils.h"
+#include "nm-utils-internal.h"
#include "nm-glib-compat.h"
#include "gsystem-local-alloc.h"
@@ -91,13 +92,13 @@ nmtst_initialized (void)
return !!__nmtst_internal.rand0;
}
-#define __NMTST_LOG(cmd, fmt, ...) \
+#define __NMTST_LOG(cmd, ...) \
G_STMT_START { \
g_assert (nmtst_initialized ()); \
if (!__nmtst_internal.assert_logging || __nmtst_internal.no_expect_message) { \
- cmd (fmt, __VA_ARGS__); \
+ cmd (__VA_ARGS__); \
} else { \
- printf (fmt "\n", __VA_ARGS__); \
+ printf (_NM_UTILS_MACRO_FIRST (__VA_ARGS__) "\n" _NM_UTILS_MACRO_REST (__VA_ARGS__)); \
} \
} G_STMT_END