]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
test-service: Write diagnostics to stderr
authorSimon McVittie <smcv@collabora.com>
Fri, 16 Nov 2018 19:22:42 +0000 (19:22 +0000)
committerSimon McVittie <smcv@collabora.com>
Mon, 3 Dec 2018 17:42:48 +0000 (17:42 +0000)
When run by a TAP test, stdout is reserved for machine-readable
TAP output.

Signed-off-by: Simon McVittie <smcv@collabora.com>
test/test-service.c

index 52ea38330ca5bae23b931f9532b668000f06e335..34bedb2d53541b287a82e244ac28a6f974edcda3 100644 (file)
@@ -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)