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
This commit is contained in:
Xavier Claessens
2012-04-18 08:50:07 +02:00
committed by David Zeuthen
parent f8a8e90398
commit 1b5f70b5b0
30 changed files with 838 additions and 469 deletions

View File

@@ -105,7 +105,6 @@ test_connection_flush (void)
}
g_dbus_connection_signal_unsubscribe (connection, signal_handler_id);
_g_object_wait_for_single_ref (connection);
g_object_unref (connection);
session_bus_down ();
@@ -202,11 +201,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/connection/flush", test_connection_flush);
g_test_add_func ("/gdbus/connection/large_message", test_connection_large_message);