summaryrefslogtreecommitdiff
path: root/gio/tests/gdbus-proxy-well-known-name.c
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.co.uk>2012-04-18 08:50:07 +0200
committerDavid Zeuthen <davidz@redhat.com>2012-04-18 11:19:13 -0400
commit1b5f70b5b035019ba28da6a5db6eff8122e17ae7 (patch)
treec258551532e3f830e2d658a2c091212f907992c7 /gio/tests/gdbus-proxy-well-known-name.c
parentf8a8e9039889c090fb3323e195730b9e460396e4 (diff)
downloadglib-1b5f70b5b035019ba28da6a5db6eff8122e17ae7.tar.gz
Add GTestDBus object
This is a helper to write unit tests using a private dbus-daemon. session_bus_up/down() are now just wrappers around a GTestDBus singleton. https://bugzilla.gnome.org/show_bug.cgi?id=672985
Diffstat (limited to 'gio/tests/gdbus-proxy-well-known-name.c')
-rw-r--r--gio/tests/gdbus-proxy-well-known-name.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/gio/tests/gdbus-proxy-well-known-name.c b/gio/tests/gdbus-proxy-well-known-name.c
index a599ef6c5..b2d204d17 100644
--- a/gio/tests/gdbus-proxy-well-known-name.c
+++ b/gio/tests/gdbus-proxy-well-known-name.c
@@ -63,11 +63,6 @@ test_proxy_well_known_name (void)
session_bus_up ();
- /* TODO: wait a bit for the bus to come up.. ideally session_bus_up() won't return
- * until one can connect to the bus but that's not how things work right now
- */
- usleep (500 * 1000);
-
error = NULL;
c = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error);
g_assert_no_error (error);
@@ -270,11 +265,7 @@ main (int argc,
/* all the tests rely on a shared main loop */
loop = g_main_loop_new (NULL, FALSE);
- /* all the tests use a session bus with a well-known address that we can bring up and down
- * using session_bus_up() and session_bus_down().
- */
- g_unsetenv ("DISPLAY");
- g_setenv ("DBUS_SESSION_BUS_ADDRESS", session_bus_get_temporary_address (), TRUE);
+ g_test_dbus_unset ();
g_test_add_func ("/gdbus/proxy-well-known-name", test_proxy_well_known_name);