[folks] tests: Unset the DBUS_SESSION_BUS_[PID|WINDOWID] variables



commit 7301078c0934d5d931460ba7109762536d6cd328
Author: Philip Withnall <philip tecnocode co uk>
Date:   Sun Feb 16 18:18:29 2014 +0000

    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

 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 a7c1f7a..fac2fa1 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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]