summaryrefslogtreecommitdiff
path: root/test/test-utils.c
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2011-01-24 17:11:52 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2011-06-13 17:30:43 +0100
commit40b5dc824aaf3b6ab71d7827fb66e080109a11e7 (patch)
treef1c4b843bb3df9648ea4c61d74e83821f28acbcc /test/test-utils.c
parentf567a7f7192c62310fc57cda7350d7e9de5d082b (diff)
downloaddbus-40b5dc824aaf3b6ab71d7827fb66e080109a11e7.tar.gz
Add a stub _dbus_loop_toggle_watch and call it where needed
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33337 Bug-NB: NB#197191
Diffstat (limited to 'test/test-utils.c')
-rw-r--r--test/test-utils.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/test/test-utils.c b/test/test-utils.c
index 4fd84fe8..c3c3ed34 100644
--- a/test/test-utils.c
+++ b/test/test-utils.c
@@ -26,6 +26,15 @@ remove_watch (DBusWatch *watch,
_dbus_loop_remove_watch (cd->loop, watch);
}
+static void
+toggle_watch (DBusWatch *watch,
+ void *data)
+{
+ CData *cd = data;
+
+ _dbus_loop_toggle_watch (cd->loop, watch);
+}
+
static dbus_bool_t
add_timeout (DBusTimeout *timeout,
void *data)
@@ -103,15 +112,10 @@ test_connection_setup (DBusLoop *loop,
if (cd == NULL)
goto nomem;
- /* Because dbus-mainloop.c checks dbus_timeout_get_enabled(),
- * dbus_watch_get_enabled() directly, we don't have to provide
- * "toggled" callbacks.
- */
-
if (!dbus_connection_set_watch_functions (connection,
add_watch,
remove_watch,
- NULL,
+ toggle_watch,
cd, cdata_free))
goto nomem;
@@ -213,6 +217,15 @@ add_server_watch (DBusWatch *watch,
}
static void
+toggle_server_watch (DBusWatch *watch,
+ void *data)
+{
+ ServerData *context = data;
+
+ _dbus_loop_toggle_watch (context->loop, watch);
+}
+
+static void
remove_server_watch (DBusWatch *watch,
void *data)
{
@@ -252,7 +265,7 @@ test_server_setup (DBusLoop *loop,
if (!dbus_server_set_watch_functions (server,
add_server_watch,
remove_server_watch,
- NULL,
+ toggle_server_watch,
sd,
serverdata_free))
{