[gtk+] Work around g_test_dbus annoyance



commit 8f3ffe4d082063fb761626cdef527c2baf62f299
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Nov 19 19:56:19 2015 -0500

    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 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/testsuite/gtk/defaultvalue.c b/testsuite/gtk/defaultvalue.c
index 2925459..557cdd4 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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]