Work around g_test_dbus annoyance

Without iterating a mainloop for a bit, g_test_dbus_down() will
give us an error.
This commit is contained in:
Matthias Clasen 2015-11-19 19:56:19 -05:00
parent 4aceee71c5
commit 8f3ffe4d08

View File

@ -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);