From 11bdff4b32565e123d13298f91424acf1ec43847 Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@collabora.com>
Date: Thu, 4 Jun 2020 14:17:47 +0100
Subject: [PATCH] test-utils: Rely on libglnx to redefine some of the test
 macros

If we try to redefine g_test_skip(), and so does libglnx, then we fight.
Including libglnx first worked, because our redefinition was
conditional on it not already having been redefined; but including our
redefinition first didn't work, because libglnx's redefinition is only
conditional on the GLib version number.

Signed-off-by: Simon McVittie <smcv@collabora.com>
---
 tests/test-utils.h | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/tests/test-utils.h b/tests/test-utils.h
index 669967d5e..5e0f774c4 100644
--- a/tests/test-utils.h
+++ b/tests/test-utils.h
@@ -32,6 +32,9 @@
 
 #include <glib.h>
 
+/* for its backports of g_test_skip(), etc. */
+#include <libglnx/libglnx.h>
+
 #ifndef g_assert_true
 #define g_assert_true(x) g_assert ((x))
 #endif
@@ -52,15 +55,3 @@
 #ifndef g_assert_cmpstr
 #define g_assert_cmpstr(a, op, b) g_assert (g_strcmp0 ((a), (b)) op 0)
 #endif
-
-#ifndef g_assert_nonnull
-#define g_assert_nonnull(x) g_assert ((x) != NULL)
-#endif
-
-#ifndef g_assert_null
-#define g_assert_null(x) g_assert ((x) == NULL)
-#endif
-
-#if !GLIB_CHECK_VERSION(2, 38, 0) && !defined(g_test_skip)
-#define g_test_skip(msg) g_test_message ("SKIP: %s", msg)
-#endif
-- 
GitLab