mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-04 08:23:38 +02:00
Tests: add session_bus_run() and use it where possible
This is to avoid having again the subtil bug in dbus-appinfo.c: session_bus_down() was called before g_test_run() so the test was running on the user's dbus session. https://bugzilla.gnome.org/show_bug.cgi?id=697348
This commit is contained in:
@@ -1732,15 +1732,11 @@ int
|
||||
main (int argc,
|
||||
char *argv[])
|
||||
{
|
||||
gint ret;
|
||||
|
||||
g_test_init (&argc, &argv, NULL);
|
||||
|
||||
/* all the tests rely on a shared main loop */
|
||||
loop = g_main_loop_new (NULL, FALSE);
|
||||
|
||||
session_bus_up ();
|
||||
|
||||
g_test_add_func ("/gdbus/object-registration", test_object_registration);
|
||||
g_test_add_func ("/gdbus/registered-interfaces", test_registered_interfaces);
|
||||
g_test_add_func ("/gdbus/async-properties", test_async_properties);
|
||||
@@ -1748,10 +1744,5 @@ main (int argc,
|
||||
/* TODO: check that we spit out correct introspection data */
|
||||
/* TODO: check that registering a whole subtree works */
|
||||
|
||||
ret = g_test_run();
|
||||
|
||||
/* tear down bus */
|
||||
session_bus_down ();
|
||||
|
||||
return ret;
|
||||
return session_bus_run ();
|
||||
}
|
||||
|
Reference in New Issue
Block a user