diff options
author | Thomas Haller <thaller@redhat.com> | 2015-11-02 15:21:02 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2015-11-02 15:36:01 +0100 |
commit | ebe8eb2ac394523d94138057a168fa29c0c3ea0d (patch) | |
tree | 980fced7190bbb5ab130a1c74c5f9e63d100fdc2 | |
parent | a43461b51c2d71e609450892063de9e7519bb682 (diff) |
test: disable g_log_set_always_fatal() for non-assert tests on older glib versions
This fixes test-failure for src/platform/tests/test-link-fake on older
systems.
-rw-r--r-- | include/nm-test-utils.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/nm-test-utils.h b/include/nm-test-utils.h index 9f40be9c1..8ab2f84da 100644 --- a/include/nm-test-utils.h +++ b/include/nm-test-utils.h @@ -400,8 +400,13 @@ __nmtst_init (int *argc, char ***argv, gboolean assert_logging, const char *log_ *out_set_logging = TRUE; #endif g_assert (success); +#if GLIB_CHECK_VERSION(2,34,0) if (__nmtst_internal.no_expect_message) g_log_set_always_fatal (G_LOG_FATAL_MASK); +#else + /* g_test_expect_message() is a NOP, so allow any messages */ + g_log_set_always_fatal (G_LOG_FATAL_MASK); +#endif } else if (__nmtst_internal.no_expect_message) { /* We have a test that would be assert_logging, but the user specified no_expect_message. * This transforms g_test_expect_message() into a NOP, but we also have to relax |