From: Simon McVittie Date: Fri, 16 Nov 2018 19:22:42 +0000 (+0000) Subject: test-service: Write diagnostics to stderr X-Git-Tag: dbus-1.13.10~56^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ebe5744375885542daadddd84b143a4414bae513;p=thirdparty%2Fdbus.git test-service: Write diagnostics to stderr When run by a TAP test, stdout is reserved for machine-readable TAP output. Signed-off-by: Simon McVittie --- diff --git a/test/test-service.c b/test/test-service.c index 52ea38330..34bedb2d5 100644 --- a/test/test-service.c +++ b/test/test-service.c @@ -61,7 +61,7 @@ check_hello_from_self_reply (DBusPendingCall *pcall, if (type == DBUS_MESSAGE_TYPE_METHOD_RETURN) { const char *s; - printf ("Reply from HelloFromSelf received\n"); + fprintf (stderr, "Reply from HelloFromSelf received\n"); if (!dbus_message_get_args (echo_message, &error, @@ -95,7 +95,7 @@ check_hello_from_self_reply (DBusPendingCall *pcall, } else if (dbus_set_error_from_message (&error, reply)) { - printf ("Error type in reply: %s\n", error.message); + fprintf (stderr, "Error type in reply: %s\n", error.message); if (strcmp (error.name, DBUS_ERROR_NO_MEMORY) != 0) { @@ -156,7 +156,7 @@ handle_run_hello_from_self (DBusConnection *connection, return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; } - printf ("Sending HelloFromSelf\n"); + fprintf (stderr, "Sending HelloFromSelf\n"); _dbus_verbose ("*** Sending message to self\n"); self_message = dbus_message_new_method_call ("org.freedesktop.DBus.TestSuiteEchoService", @@ -174,7 +174,7 @@ handle_run_hello_from_self (DBusConnection *connection, if (!dbus_pending_call_set_notify (pcall, check_hello_from_self_reply, (void *)message, NULL)) die("No memory"); - printf ("Sent HelloFromSelf\n"); + fprintf (stderr, "Sent HelloFromSelf\n"); return DBUS_HANDLER_RESULT_HANDLED; } @@ -351,7 +351,7 @@ path_message_func (DBusConnection *connection, "HelloFromSelf")) { DBusMessage *reply; - printf ("Received the HelloFromSelf message\n"); + fprintf (stderr, "Received the HelloFromSelf message\n"); reply = dbus_message_new_method_return (message); if (reply == NULL)