summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-04-09 15:35:00 +0200
committerThomas Haller <thaller@redhat.com>2015-04-09 16:39:13 +0200
commit373d09b0425c6dfb699ee4b6615ded0177d0e344 (patch)
tree34abc4e6bad75ae4ad6e12148dd840c956b223f0
parent745f2aceac32771ebf55d67597c7726113f675d2 (diff)
downloadNetworkManager-373d09b0425c6dfb699ee4b6615ded0177d0e344.tar.gz
test: log message at g_test_assert_expected_messages()
When disabling assert-logging with no-expect-message, print a line at every g_test_assert_expected_messages() invocation.
-rw-r--r--include/nm-test-utils.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/include/nm-test-utils.h b/include/nm-test-utils.h
index eea4a611ac..ca244bdf41 100644
--- a/include/nm-test-utils.h
+++ b/include/nm-test-utils.h
@@ -135,8 +135,9 @@ struct __nmtst_internal __nmtst_internal = { 0 }; \
__attribute__ ((destructor)) static void \
_nmtst_exit (void) \
{ \
- nmtst_free (); \
+ __nmtst_internal.assert_logging = FALSE; \
g_test_assert_expected_messages (); \
+ nmtst_free (); \
}
@@ -434,13 +435,24 @@ nmtst_is_debug (void)
G_STMT_START { \
g_assert (nmtst_initialized ()); \
if (__nmtst_internal.assert_logging && __nmtst_internal.no_expect_message) { \
- g_debug ("nmtst: swallow g_test_expect_message %s", G_STRINGIFY ((__VA_ARGS__))); \
+ g_debug ("nmtst: assert-logging: g_test_expect_message %s", G_STRINGIFY ((__VA_ARGS__))); \
} else { \
G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
g_test_expect_message (__VA_ARGS__); \
G_GNUC_END_IGNORE_DEPRECATIONS \
} \
} G_STMT_END
+#undef g_test_assert_expected_messages_internal
+#define g_test_assert_expected_messages_internal(domain, file, line, func) \
+ G_STMT_START { \
+ 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_GNUC_BEGIN_IGNORE_DEPRECATIONS \
+ g_test_assert_expected_messages_internal (domain, file, line, func); \
+ G_GNUC_END_IGNORE_DEPRECATIONS \
+ } G_STMT_END
#endif
inline static GRand *