summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2013-10-08 13:12:56 -0400
committerDan Winship <danw@gnome.org>2013-10-08 13:14:35 -0400
commitbf4afcdaa5443cb9bc8829817b3a510010a99325 (patch)
tree8dfe459731c3b1c9fac2dff079d90727a32e3543
parentfb2fddb3ed7e5a8c51d928bfe8be6f3e198d4a02 (diff)
downloadlibsoup-bf4afcdaa5443cb9bc8829817b3a510010a99325.tar.gz
tests: fix another test broken by the SoupClientInputStream close change
One of connection-test's tests was failing (but only sporadically) because it closed the stream without reading it, causing the stream to be disconnected, while it was expecting the connection to stay open.
-rw-r--r--tests/connection-test.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/connection-test.c b/tests/connection-test.c
index cdc4cced..3d517539 100644
--- a/tests/connection-test.c
+++ b/tests/connection-test.c
@@ -325,6 +325,14 @@ do_timeout_req_test_for_session (SoupSession *session)
errors++;
g_clear_error (&error);
} else {
+ soup_test_request_read_all (req, stream, NULL, &error);
+ if (error) {
+ debug_printf (1, " Unexpected error on read: %s\n",
+ error->message);
+ errors++;
+ g_clear_error (&error);
+ }
+
soup_test_request_close_stream (req, stream, NULL, &error);
if (error) {
debug_printf (1, " Unexpected error on close: %s\n",
@@ -400,6 +408,7 @@ do_persistent_connection_timeout_test (void)
do_timeout_test_for_session (session);
soup_test_session_abort_unref (session);
+ debug_printf (1, " Async session, request API\n");
session = soup_test_session_new (SOUP_TYPE_SESSION_ASYNC,
SOUP_SESSION_USE_THREAD_CONTEXT, TRUE,
NULL);
@@ -411,6 +420,7 @@ do_persistent_connection_timeout_test (void)
do_timeout_test_for_session (session);
soup_test_session_abort_unref (session);
+ debug_printf (1, " Sync session, request API\n");
session = soup_test_session_new (SOUP_TYPE_SESSION_SYNC, NULL);
do_timeout_req_test_for_session (session);
soup_test_session_abort_unref (session);