[daemon-fix] Changed the way of make bus address when the address is not given
[platform/upstream/dbus.git] / bus / test.c
index 049fae6..31ef4c8 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <config.h>
 
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
 #include "test.h"
 #include <dbus/dbus-internals.h>
 #include <dbus/dbus-list.h>
@@ -40,8 +40,6 @@ static dbus_bool_t
 add_client_watch (DBusWatch      *watch,
                   void           *data)
 {
-  DBusConnection *connection = data;
-
   return _dbus_loop_add_watch (client_loop, watch);
 }
 
@@ -49,17 +47,20 @@ static void
 remove_client_watch (DBusWatch      *watch,
                      void           *data)
 {
-  DBusConnection *connection = data;
-
   _dbus_loop_remove_watch (client_loop, watch);
 }
 
+static void
+toggle_client_watch (DBusWatch      *watch,
+                     void           *data)
+{
+  _dbus_loop_toggle_watch (client_loop, watch);
+}
+
 static dbus_bool_t
 add_client_timeout (DBusTimeout    *timeout,
                     void           *data)
 {
-  DBusConnection *connection = data;
-
   return _dbus_loop_add_timeout (client_loop, timeout);
 }
 
@@ -67,8 +68,6 @@ static void
 remove_client_timeout (DBusTimeout    *timeout,
                        void           *data)
 {
-  DBusConnection *connection = data;
-
   _dbus_loop_remove_timeout (client_loop, timeout);
 }
 
@@ -120,7 +119,7 @@ bus_setup_debug_client (DBusConnection *connection)
   if (!dbus_connection_set_watch_functions (connection,
                                             add_client_watch,
                                             remove_client_watch,
-                                            NULL,
+                                            toggle_client_watch,
                                             connection,
                                             NULL))
     goto out;
@@ -293,7 +292,7 @@ bus_context_new_test (const DBusString *test_data_dir,
     }
 
   dbus_error_init (&error);
-  context = bus_context_new (&config_file, FALSE, NULL, NULL, NULL, FALSE, &error);
+  context = bus_context_new (&config_file, BUS_CONTEXT_FLAG_NONE, NULL, NULL, NULL, &error);
   if (context == NULL)
     {
       _DBUS_ASSERT_ERROR_IS_SET (&error);