tests: Reuse GLib compatibility code

Instead of disabling the code use the compatibility functions.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
This commit is contained in:
Frediano Ziglio 2017-03-02 13:46:05 +00:00
parent 73f8a65d06
commit a22a76371e
2 changed files with 1 additions and 7 deletions

View File

@ -122,6 +122,7 @@ test_vdagent_CPPFLAGS = \
-UGLIB_VERSION_MIN_REQUIRED \
-UGLIB_VERSION_MAX_ALLOWED \
$(NULL)
test_codecs_parsing_CPPFLAGS = $(test_vdagent_CPPFLAGS)
if HAVE_GSTREAMER
test_gst_SOURCES = test-gst.c \

View File

@ -45,9 +45,6 @@ static void codecs_good(void)
spice_server_destroy(server);
}
/* g_test_expect_message is available since Glib 2.34 */
#if GLIB_CHECK_VERSION(2, 34, 0)
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
static void codecs_bad(void)
{
guint i;
@ -137,17 +134,13 @@ static void codecs_bad(void)
spice_server_destroy(server);
}
G_GNUC_END_IGNORE_DEPRECATIONS
#endif
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();
}