summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2011-09-22 13:50:11 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2013-10-21 12:37:45 +0100
commit79d817e8c11f9dd45f83da30f864f31641e05ac0 (patch)
tree4c63bea43bbc29fe02531c8ba31bbbcbd005a53a
parent230751f4e63a65294739087ea994bafb320ca3f6 (diff)
downloaddbus-glib-79d817e8c11f9dd45f83da30f864f31641e05ac0.tar.gz
test-client: wait for disconnection, to get more state freed
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=41129 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
-rw-r--r--test/interfaces/test-client.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/test/interfaces/test-client.c b/test/interfaces/test-client.c
index 1fbc3ee..9ec30c7 100644
--- a/test/interfaces/test-client.c
+++ b/test/interfaces/test-client.c
@@ -2,6 +2,10 @@
#include <stdlib.h>
#include <string.h>
+
+#include <dbus/dbus-glib.h>
+#include <dbus/dbus-glib-lowlevel.h>
+
#include "dbus/dbus-gparser.h"
#include "test-song-bindings.h"
#include "test-hello-bindings.h"
@@ -9,6 +13,8 @@
#include "test-dup-prop-a-bindings.h"
#include "test-dup-prop-b-bindings.h"
+#include "test/lib/util.h"
+
#define TEST_NAMESPACE "org.freedesktop.DBus.GLib.Test.Interfaces"
#define TEST_OBJECT_PATH "/org/freedesktop/DBus/GLib/Test/Interfaces"
#define TEST_DP_OBJECT_PATH "/org/freedesktop/DBus/GLib/Test/DupPropInterfaces"
@@ -96,7 +102,7 @@ main (int argc,
g_type_init ();
- connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
+ connection = dbus_g_bus_get_private (DBUS_BUS_SESSION, NULL, &error);
if (connection == NULL)
{
g_error ("Failed to make connection to session bus: %s", error->message);
@@ -104,6 +110,9 @@ main (int argc,
exit(1);
}
+ dbus_connection_set_exit_on_disconnect (dbus_g_connection_get_connection (connection),
+ FALSE);
+
proxy = dbus_g_proxy_new_for_name (connection, TEST_NAMESPACE, TEST_OBJECT_PATH,
"org.freedesktop.DBus.GLib.Test.Interfaces.Song");
success = org_freedesktop_DBus_GLib_Test_Interfaces_Song_get_title (proxy, &str, &error);
@@ -270,6 +279,10 @@ main (int argc,
g_object_unref (dp_proxy);
+ test_run_until_disconnected (connection, NULL);
+ dbus_g_connection_unref (connection);
+
+ dbus_shutdown ();
exit(0);
}