diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2011-04-05 17:43:15 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2011-08-17 19:19:24 +0100 |
commit | 4bc172fd5f31123ee883c4027e729b38c2777d7d (patch) | |
tree | 07ae2bc1612b16e2b126a4d87eb7ec7b874c340f | |
parent | 9e97f9744e7ffeb04a105087da6143931195ce77 (diff) |
test-dbus-glib: make lose() abort, and make lose_gerror() more informative
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
-rw-r--r-- | test/core/test-dbus-glib.c | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/test/core/test-dbus-glib.c b/test/core/test-dbus-glib.c index 9125338..54e100f 100644 --- a/test/core/test-dbus-glib.c +++ b/test/core/test-dbus-glib.c @@ -30,7 +30,8 @@ static gboolean proxy_destroy_and_nameowner_complete = FALSE; static DBusGProxy *test_terminate_proxy1 = NULL; static DBusGProxy *test_terminate_proxy2 = NULL; -static void lose (const char *fmt, ...) G_GNUC_NORETURN G_GNUC_PRINTF (1, 2); +#define lose(...) g_error (__VA_ARGS__) + static void lose_gerror (const char *prefix, GError *error) G_GNUC_NORETURN; static void @@ -467,28 +468,14 @@ test_subclass_get_all (DBusGConnection *connection, } static void -lose (const char *str, ...) -{ - va_list args; - - va_start (args, str); - - vfprintf (stderr, str, args); - fputc ('\n', stderr); - - va_end (args); - - exit (1); -} - -static void lose_gerror (const char *prefix, GError *error) { if (error->domain == DBUS_GERROR && error->code == DBUS_GERROR_REMOTE_EXCEPTION) lose ("%s (%s): %s", prefix, dbus_g_error_get_name (error), error->message); else - lose ("%s: %s", prefix, error->message); + lose ("%s: %s#%d: %s", prefix, g_quark_to_string (error->domain), + error->code, error->message); } static void |