diff options
author | Philip Withnall <philip@tecnocode.co.uk> | 2014-02-16 18:18:29 +0000 |
---|---|---|
committer | Philip Withnall <philip@tecnocode.co.uk> | 2014-02-16 20:38:31 +0000 |
commit | 7301078c0934d5d931460ba7109762536d6cd328 (patch) | |
tree | 271ab051864096a30932d36b3d9d762e0da43a73 | |
parent | d98b0903df5a5a76e9897c1cf82f8417268cc7b8 (diff) |
tests: Unset the DBUS_SESSION_BUS_[PID|WINDOWID] variables
Might as well do a complete job when unsetting environment variables
which are associated with D-Bus.
This is a tweaked version of the patch from
bug: https://bugzilla.gnome.org/show_bug.cgi?id=712148
-rw-r--r-- | tests/lib/gtestdbus.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/tests/lib/gtestdbus.c b/tests/lib/gtestdbus.c index a7c1f7a8..fac2fa17 100644 --- a/tests/lib/gtestdbus.c +++ b/tests/lib/gtestdbus.c @@ -702,6 +702,8 @@ common_envar_unset (void) /* Always want to unset the starter address since we don't support simulating * auto-launched buses */ g_unsetenv ("DISPLAY"); + g_unsetenv ("DBUS_SESSION_BUS_PID"); + g_unsetenv ("DBUS_SESSION_BUS_WINDOWID"); g_unsetenv ("DBUS_STARTER_ADDRESS"); g_unsetenv ("DBUS_STARTER_BUS_TYPE"); } @@ -907,9 +909,17 @@ folks_test_dbus_down (FolksTestDBus *self) /** * folks_test_dbus_unset: * - * Unset the <envar>DISPLAY</envar>, <envar>DBUS_SESSION_BUS_ADDRESS</envar> - * and <envar>DBUS_SYSTEM_BUS_ADDRESS</envar> environment variables to ensure the - * test won't use the user's session (or system) bus. + * Unset various D-Bus environment variables to ensure the test won't use the + * user's session (or system) bus: + * <itemizedlist> + * <listitem><para>DISPLAY</para></listitem> + * <listitem><para>DBUS_SESSION_BUS_ADDRESS</para></listitem> + * <listitem><para>DBUS_SESSION_BUS_PID</para></listitem> + * <listitem><para>DBUS_SESSION_BUS_WINDOWID</para></listitem> + * <listitem><para>DBUS_SYSTEM_BUS_ADDRESS</para></listitem> + * <listitem><para>DBUS_STARTER_ADDRESS</para></listitem> + * <listitem><para>DBUS_STARTER_BUS_TYPE</para></listitem> + * </itemizedlist> * * This is useful for unit tests that want to verify behaviour when no session * (or system) bus is running. It is not necessary to call this if the unit test |