2003-04-10 Havoc Pennington <hp@pobox.com>
[platform/upstream/dbus.git] / test / test-service.c
index a9a960a..9d5ecee 100644 (file)
@@ -2,7 +2,7 @@
 #include "test-utils.h"
 
 static DBusLoop *loop;
-static dbus_bool_t already_quit;
+static dbus_bool_t already_quit = FALSE;
 
 static void
 quit (void)
@@ -27,6 +27,7 @@ handle_echo (DBusConnection     *connection,
 {
   DBusError error;
   DBusMessage *reply;
+  DBusMessageIter iter;
   char *s;
   
   dbus_error_init (&error);
@@ -55,7 +56,9 @@ handle_echo (DBusConnection     *connection,
   if (reply == NULL)
     die ("No memory\n");
 
-  if (!dbus_message_append_string (reply, s))
+  dbus_message_append_iter_init (message, &iter);
+  
+  if (!dbus_message_iter_append_string (&iter, s))
     die ("No memory");
 
   if (!dbus_connection_send (connection, reply, NULL))
@@ -137,7 +140,8 @@ main (int    argc,
       dbus_error_free (&error);
       exit (1);
     }
-  
+
+  _dbus_verbose ("*** Test service entering main loop\n");
   _dbus_loop_run (loop);
 
   test_connection_shutdown (loop, connection);
@@ -151,7 +155,7 @@ main (int    argc,
   
   dbus_shutdown ();
 
-  printf ("*** Test service exiting\n");
+  _dbus_verbose ("*** Test service exiting\n");
   
   return 0;
 }