[Spice-devel] [PATCH spice-server 3/3] tests: Reuse GLib compatibility code

Frediano Ziglio fziglio at redhat.com
Thu Mar 2 13:50:03 UTC 2017


Instead of disabling the code use the compatibility functions.

Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 server/tests/test-codecs-parsing.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/server/tests/test-codecs-parsing.c b/server/tests/test-codecs-parsing.c
index 571d8ab..838a80c 100644
--- a/server/tests/test-codecs-parsing.c
+++ b/server/tests/test-codecs-parsing.c
@@ -46,8 +46,9 @@ static void codecs_good(void)
 }
 
 /* g_test_expect_message is available since Glib 2.34 */
-#if GLIB_CHECK_VERSION(2, 34, 0)
+#ifdef G_GNUC_BEGIN_IGNORE_DEPRECATIONS
 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+#endif
 static void codecs_bad(void)
 {
     guint i;
@@ -137,6 +138,7 @@ static void codecs_bad(void)
 
     spice_server_destroy(server);
 }
+#ifdef G_GNUC_BEGIN_IGNORE_DEPRECATIONS
 G_GNUC_END_IGNORE_DEPRECATIONS
 #endif
 
@@ -145,9 +147,7 @@ int main(int argc, char *argv[])
     g_test_init(&argc, &argv, NULL);
 
     g_test_add_func("/server/codecs-good", codecs_good);
-#if GLIB_CHECK_VERSION(2, 34, 0)
     g_test_add_func("/server/codecs-bad", codecs_bad);
-#endif
 
     return g_test_run();
 }
-- 
2.9.3



More information about the Spice-devel mailing list