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:
Xavier Claessens
2013-10-28 17:18:54 -04:00
parent 5280c03368
commit 940fa98290
7 changed files with 17 additions and 38 deletions

View File

@@ -303,23 +303,15 @@ 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/introspection-parser", test_introspection_parser);
g_test_add_func ("/gdbus/introspection-generate", test_generate);
g_test_add_func ("/gdbus/introspection-default-direction", test_default_direction);
g_test_add_func ("/gdbus/introspection-extra-data", test_extra_data);
ret = g_test_run ();
session_bus_down ();
return ret;
return session_bus_run ();
}