From 8f3ffe4d082063fb761626cdef527c2baf62f299 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 19 Nov 2015 19:56:19 -0500 Subject: [PATCH] Work around g_test_dbus annoyance Without iterating a mainloop for a bit, g_test_dbus_down() will give us an error. --- testsuite/gtk/defaultvalue.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/testsuite/gtk/defaultvalue.c b/testsuite/gtk/defaultvalue.c index 29254595d6..557cdd48f9 100644 --- a/testsuite/gtk/defaultvalue.c +++ b/testsuite/gtk/defaultvalue.c @@ -411,6 +411,7 @@ main (int argc, char **argv) guint i; gchar *schema_dir; GTestDBus *bus; + GMainLoop *loop; gint result; /* These must be set before before gtk_test_init */ @@ -446,6 +447,14 @@ main (int argc, char **argv) result = g_test_run(); + /* Work around the annoying issue that g_test_dbus_down is giving + * us an "Error while sending AddMatch" that comes out of an idle + */ + loop = g_main_loop_new (NULL, FALSE); + g_timeout_add (1000, (GSourceFunc)g_main_loop_quit, loop); + g_main_loop_run (loop); + g_main_loop_unref (loop); + g_test_dbus_down (bus); g_object_unref (bus); g_free (schema_dir);