summaryrefslogtreecommitdiff
path: root/test/name-test
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2016-07-11 11:09:26 +0100
committerSimon McVittie <smcv@debian.org>2016-08-12 10:25:06 +0100
commit6d8a198de928fb7088b67d81d34b0aee35e27f34 (patch)
tree6f6c84a629275c72ff129b2d56d6a2448e68b97b /test/name-test
parente9d37affcdab2b86a95c581cc3300335a0d708dc (diff)
downloaddbus-6d8a198de928fb7088b67d81d34b0aee35e27f34.tar.gz
various tests: produce better diagnostics on error
Same root cause as <https://bugs.freedesktop.org/show_bug.cgi?id=96653>: we didn't check whether the message was in fact an error reply. Signed-off-by: Simon McVittie <smcv@debian.org>
Diffstat (limited to 'test/name-test')
-rw-r--r--test/name-test/test-privserver-client.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/name-test/test-privserver-client.c b/test/name-test/test-privserver-client.c
index 56b553c0..4268516a 100644
--- a/test/name-test/test-privserver-client.c
+++ b/test/name-test/test-privserver-client.c
@@ -100,6 +100,10 @@ open_shutdown_private_connection (dbus_bool_t use_guid)
if (!(reply = dbus_connection_send_with_reply_and_block (session, msg, -1, &error)))
die ("couldn't send message: %s\n", error.message);
dbus_message_unref (msg);
+
+ if (dbus_set_error_from_message (&error, reply))
+ die ("%s: %s", error.name, error.message);
+
if (!dbus_message_get_args (reply, &error, DBUS_TYPE_STRING, &addr, DBUS_TYPE_INVALID))
die ("couldn't parse message replym\n");
printf ("# got private temp address %s\n", addr);