From 418b79ab7fbc28c9f363b537c42402f15f100169 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Wed, 13 Mar 2019 13:18:38 +0000 Subject: [PATCH] tests: Use g_assert_cmpvariant() from GLib 2.60 Signed-off-by: Philip Withnall --- libmalcontent/tests/app-filter.c | 23 +---------------------- libmalcontent/tests/meson.build | 2 +- 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/libmalcontent/tests/app-filter.c b/libmalcontent/tests/app-filter.c index 0372fba..7eecaf4 100644 --- a/libmalcontent/tests/app-filter.c +++ b/libmalcontent/tests/app-filter.c @@ -48,27 +48,6 @@ assert_strv_equal (const gchar * const *strv_a, g_assert_null (strv_b[i]); } -/* FIXME: Use g_assert_cmpvariant() when - * https://gitlab.gnome.org/GNOME/glib/issues/1191 is fixed. */ -#define assert_cmpvariant(v1, v2) \ - G_STMT_START \ - { \ - GVariant *__v1 = (v1), *__v2 = (v2); \ - if (!g_variant_equal (__v1, __v2)) \ - { \ - gchar *__s1, *__s2, *__msg; \ - __s1 = g_variant_print (__v1, TRUE); \ - __s2 = g_variant_print (__v2, TRUE); \ - __msg = g_strdup_printf ("assertion failed (" #v1 " == " #v2 "): %s does not equal %s", __s1, __s2); \ - g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, __msg); \ - g_free (__s1); \ - g_free (__s2); \ - g_free (__msg); \ - } \ - } \ - G_STMT_END - - /* A placeholder smoketest which checks that the error quark works. */ static void test_app_filter_error_quark (void) @@ -1093,7 +1072,7 @@ set_app_filter_server_cb (GtDBusQueue *queue, else { expected_property_value = g_variant_new_parsed (set_app_filter_data_get_expected_property_value (data, property_name)); - assert_cmpvariant (property_value, expected_property_value); + g_assert_cmpvariant (property_value, expected_property_value); g_dbus_method_invocation_return_value (property_invocation, NULL); } diff --git a/libmalcontent/tests/meson.build b/libmalcontent/tests/meson.build index 39a000c..a8a815a 100644 --- a/libmalcontent/tests/meson.build +++ b/libmalcontent/tests/meson.build @@ -1,7 +1,7 @@ deps = [ dependency('gio-2.0', version: '>= 2.60.1'), dependency('gio-unix-2.0', version: '>= 2.44'), - dependency('glib-2.0', version: '>= 2.54.2'), + dependency('glib-2.0', version: '>= 2.60.0'), dependency('gobject-2.0', version: '>= 2.44'), libmalcontent_dep, libglib_testing_dep,