diff options
-rw-r--r-- | tests/wocky-connector-test.c | 15 | ||||
-rw-r--r-- | tests/wocky-test-connector-server.c | 13 |
2 files changed, 24 insertions, 4 deletions
diff --git a/tests/wocky-connector-test.c b/tests/wocky-connector-test.c index 7811ea1..e08710e 100644 --- a/tests/wocky-connector-test.c +++ b/tests/wocky-connector-test.c @@ -3385,8 +3385,19 @@ test_server_teardown_cb (GObject *source, static gboolean test_server_idle_quit_loop_cb (GMainLoop *loop) { - g_main_loop_quit (loop); - return G_SOURCE_REMOVE; + static int retries = 0; + + if (retries == 5) + { + g_main_loop_quit (loop); + retries = 0; + return G_SOURCE_REMOVE; + } + else + { + retries ++; + return G_SOURCE_CONTINUE; + } } static void diff --git a/tests/wocky-test-connector-server.c b/tests/wocky-test-connector-server.c index 8221267..1796ed5 100644 --- a/tests/wocky-test-connector-server.c +++ b/tests/wocky-test-connector-server.c @@ -1390,8 +1390,17 @@ force_closed_cb (GObject *source, success = wocky_xmpp_connection_force_close_finish ( WOCKY_XMPP_CONNECTION (source), result, &error); - g_assert_no_error (error); - g_assert (success); + if (success) + { + g_assert_no_error (error); + } + else if (self->priv->teardown_task && self->priv->cancellable == NULL) + { + g_assert_error (error, G_IO_ERROR, G_IO_ERROR_CANCELLED); + g_error_free (error); + } + else + g_assert_not_reached (); server_dec_outstanding (self); } |