test: Simplify error checking path in test-service slightly

This should shut up Coverity from complaining about not checking the
return value of dbus_set_error_from_message(), which is equivalent to
the (type == DBUS_MESSAGE_TYPE_ERROR) check.

Coverity ID: 54697
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99723
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
This commit is contained in:
Philip Withnall 2017-02-09 09:40:51 +00:00 committed by Simon McVittie
parent 84cd6243b3
commit f88c8a8c39

View file

@ -92,9 +92,8 @@ check_hello_from_self_reply (DBusPendingCall *pcall,
dbus_message_unref (echo_reply);
}
else if (type == DBUS_MESSAGE_TYPE_ERROR)
else if (dbus_set_error_from_message (&error, reply))
{
dbus_set_error_from_message (&error, reply);
printf ("Error type in reply: %s\n", error.message);
if (strcmp (error.name, DBUS_ERROR_NO_MEMORY) != 0)