summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2017-11-20 19:51:05 +0100
committerThomas Haller <thaller@redhat.com>2017-11-20 19:52:59 +0100
commitb8c87a7ceb8c361bc232dfca24e368ce7f237e62 (patch)
treef8cee3bfa027d3e398707191c91c41cc0b8b686e
parent89c89143b5ace4cff4a6fba9359259a010781284 (diff)
downloadNetworkManager-b8c87a7ceb8c361bc232dfca24e368ce7f237e62.tar.gz
test: conditionally enable assertion macros depending on libnm version
The test utility library "nm-utils/nm-test-utils.h" is also used by applet and VPN plugins. They may not yet use 1.10 API.
-rw-r--r--shared/nm-utils/nm-test-utils.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/shared/nm-utils/nm-test-utils.h b/shared/nm-utils/nm-test-utils.h
index 126546ec93..8d3ff10e26 100644
--- a/shared/nm-utils/nm-test-utils.h
+++ b/shared/nm-utils/nm-test-utils.h
@@ -1697,7 +1697,7 @@ nmtst_assert_setting_verifies (NMSetting *setting)
g_assert (success);
}
-#if defined(__NM_SIMPLE_CONNECTION_H__)
+#if defined(__NM_SIMPLE_CONNECTION_H__) && NM_CHECK_VERSION (1, 10, 0) && (!defined (NM_VERSION_MAX_ALLOWED) || NM_VERSION_MAX_ALLOWED >= NM_VERSION_1_10)
static inline void
_nmtst_assert_connection_has_settings (NMConnection *connection, gboolean has_at_least, gboolean has_at_most, ...)
{
@@ -1751,8 +1751,7 @@ _nmtst_assert_connection_has_settings (NMConnection *connection, gboolean has_at
#define nmtst_assert_connection_has_settings(connection, ...) _nmtst_assert_connection_has_settings ((connection), TRUE, TRUE, __VA_ARGS__, NULL)
#define nmtst_assert_connection_has_settings_at_least(connection, ...) _nmtst_assert_connection_has_settings ((connection), TRUE, FALSE, __VA_ARGS__, NULL)
#define nmtst_assert_connection_has_settings_at_most(connection, ...) _nmtst_assert_connection_has_settings ((connection), FALSE, TRUE, __VA_ARGS__, NULL)
-
-#endif /* __NM_SIMPLE_CONNECTION_H__ */
+#endif
static inline void
nmtst_assert_setting_verify_fails (NMSetting *setting,