diff options
author | Dan Winship <danw@gnome.org> | 2012-07-25 08:54:11 -0400 |
---|---|---|
committer | Dan Winship <danw@gnome.org> | 2012-07-25 08:54:11 -0400 |
commit | 6cddb7cdd31fbee94ec424993e99e0b7f7bdb90b (patch) | |
tree | 51a2b11aed811ce0e984316c3315c2fbd04df05d /tests/connection-test.c | |
parent | 1abd8ecf4211afe67b6bb3ce33061e3ae51bfe97 (diff) | |
download | libsoup-6cddb7cdd31fbee94ec424993e99e0b7f7bdb90b.tar.gz |
test-utils: simplify the SoupRequest test utils a bit
Diffstat (limited to 'tests/connection-test.c')
-rw-r--r-- | tests/connection-test.c | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/tests/connection-test.c b/tests/connection-test.c index ddf0c988..6ddc89c5 100644 --- a/tests/connection-test.c +++ b/tests/connection-test.c @@ -321,21 +321,14 @@ do_timeout_req_test_for_session (SoupSession *session) req = soup_requester_request_uri (requester, timeout_uri, NULL); soup_uri_free (timeout_uri); - if (SOUP_IS_SESSION_SYNC (session)) - stream = soup_request_send (req, NULL, &error); - else - stream = soup_test_request_send_async_as_sync (req, NULL, &error); - + stream = soup_test_request_send (req, NULL, &error); if (!stream) { debug_printf (1, " Unexpected error on send: %s\n", error->message); errors++; g_clear_error (&error); } else { - if (SOUP_IS_SESSION_SYNC (session)) - g_input_stream_close (stream, NULL, &error); - else - soup_test_stream_close_async_as_sync (stream, NULL, &error); + soup_test_request_close_stream (req, stream, NULL, &error); if (error) { debug_printf (1, " Unexpected error on close: %s\n", error->message); @@ -354,21 +347,14 @@ do_timeout_req_test_for_session (SoupSession *session) debug_printf (1, " Second request\n"); req = soup_requester_request_uri (requester, base_uri, NULL); - if (SOUP_IS_SESSION_SYNC (session)) - stream = soup_request_send (req, NULL, &error); - else - stream = soup_test_request_send_async_as_sync (req, NULL, &error); - + stream = soup_test_request_send (req, NULL, &error); if (!stream) { debug_printf (1, " Unexpected error on send: %s\n", error->message); errors++; g_clear_error (&error); } else { - if (SOUP_IS_SESSION_SYNC (session)) - g_input_stream_close (stream, NULL, &error); - else - soup_test_stream_close_async_as_sync (stream, NULL, &error); + soup_test_request_close_stream (req, stream, NULL, &error); if (error) { debug_printf (1, " Unexpected error on close: %s\n", error->message); |