diff options
Diffstat (limited to 'tests/test-utils.c')
-rw-r--r-- | tests/test-utils.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/test-utils.c b/tests/test-utils.c index 9c742060..bd1bab05 100644 --- a/tests/test-utils.c +++ b/tests/test-utils.c @@ -239,9 +239,13 @@ soup_test_session_new (GType type, ...) va_end (args); if (tls_available) { + char *abs_cafile; + cafile = g_test_build_filename (G_TEST_DIST, "test-cert.pem", NULL); - tlsdb = g_tls_file_database_new (cafile, &error); + abs_cafile = g_canonicalize_filename (cafile, NULL); g_free (cafile); + tlsdb = g_tls_file_database_new (abs_cafile, &error); + g_free (abs_cafile); if (error) { if (g_strcmp0 (g_getenv ("GIO_USE_TLS"), "dummy") == 0) g_clear_error (&error); @@ -676,9 +680,11 @@ soup_test_request_read_all (SoupRequest *req, if (!SOUP_IS_SESSION_SYNC (soup_request_get_session (req))) data.loop = g_main_loop_new (g_main_context_get_thread_default (), FALSE); + else + data.loop = NULL; do { - if (SOUP_IS_SESSION_SYNC (soup_request_get_session (req))) { + if (!data.loop) { nread = g_input_stream_read (stream, buf, sizeof (buf), cancellable, error); } else { @@ -691,7 +697,7 @@ soup_test_request_read_all (SoupRequest *req, } } while (nread > 0); - if (!SOUP_IS_SESSION_SYNC (soup_request_get_session (req))) + if (data.loop) g_main_loop_unref (data.loop); return nread == 0; |