[gtk/no-more-testdbus] Stop using GTestDBus



commit 1b265a797117198636a73ec3696d38daeb141637
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Jun 17 12:05:07 2020 -0400

    Stop using GTestDBus
    
    It is causing tests to timeout when libraries we are using
    leak bus connections, and it turns out our tests run fine
    without a session bus.

 testsuite/gtk/defaultvalue.c     | 24 +-----------------------
 testsuite/gtk/objects-finalize.c | 10 ----------
 2 files changed, 1 insertion(+), 33 deletions(-)
---
diff --git a/testsuite/gtk/defaultvalue.c b/testsuite/gtk/defaultvalue.c
index ee59c32851..15c9047a93 100644
--- a/testsuite/gtk/defaultvalue.c
+++ b/testsuite/gtk/defaultvalue.c
@@ -469,9 +469,6 @@ main (int argc, char **argv)
 {
   const GType *otypes;
   guint i;
-  GTestDBus *bus;
-  GMainLoop *loop;
-  gint result;
   const char *display, *x_r_d;
 
   /* These must be set before gtk_test_init */
@@ -483,12 +480,6 @@ main (int argc, char **argv)
   display = g_getenv ("DISPLAY");
   x_r_d = g_getenv ("XDG_RUNTIME_DIR");
 
-  /* Create one test bus for all tests, as we have a lot of very small
-   * and quick tests.
-   */
-  bus = g_test_dbus_new (G_TEST_DBUS_NONE);
-  g_test_dbus_up (bus);
-
   if (display)
     g_setenv ("DISPLAY", display, TRUE);
   if (x_r_d)
@@ -515,18 +506,5 @@ main (int argc, char **argv)
       g_free (testname);
     }
 
-  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);
-
-  return result;
+  return g_test_run();
 }
diff --git a/testsuite/gtk/objects-finalize.c b/testsuite/gtk/objects-finalize.c
index fe26c31d37..bd26c83c23 100644
--- a/testsuite/gtk/objects-finalize.c
+++ b/testsuite/gtk/objects-finalize.c
@@ -130,7 +130,6 @@ main (int argc, char **argv)
 {
   const GType *all_types;
   guint n_types = 0, i;
-  GTestDBus *bus;
   gint result;
   const char *display, *x_r_d;
 
@@ -142,12 +141,6 @@ main (int argc, char **argv)
   display = g_getenv ("DISPLAY");
   x_r_d = g_getenv ("XDG_RUNTIME_DIR");
 
-  /* Create one test bus for all tests, as we have a lot of very small
-   * and quick tests.
-   */
-  bus = g_test_dbus_new (G_TEST_DBUS_NONE);
-  g_test_dbus_up (bus);
-
   if (display)
     g_setenv ("DISPLAY", display, TRUE);
   if (x_r_d)
@@ -189,8 +182,5 @@ main (int argc, char **argv)
 
   result = g_test_run();
 
-  g_test_dbus_down (bus);
-  g_object_unref (bus);
-
   return result;
 }


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