[libsoup] session-test: fix to work with the dummy TLS backend
- From: Dan Winship <danw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsoup] session-test: fix to work with the dummy TLS backend
- Date: Sun, 17 Nov 2013 14:48:22 +0000 (UTC)
commit 16fa40768078ed676b6ffe6ad0f5334a273ed428
Author: Dan Winship <danw gnome org>
Date: Sun Nov 17 09:47:02 2013 -0500
session-test: fix to work with the dummy TLS backend
do_property_tests() apparently didn't work with the dummy TLS backend,
half because of a glib bug, and half because of a session-test bug.
This fixes the session-test bug; the glib bug is fixed in glib master.
tests/session-test.c | 21 +++++++++++++--------
1 files changed, 13 insertions(+), 8 deletions(-)
---
diff --git a/tests/session-test.c b/tests/session-test.c
index d40e776..205885d 100644
--- a/tests/session-test.c
+++ b/tests/session-test.c
@@ -368,14 +368,19 @@ do_property_tests (void)
default_proxy_resolver, NULL);
g_object_unref (session);
- tlsdb = g_tls_file_database_new (SRCDIR "/test-cert.pem", NULL);
- session = g_object_new (SOUP_TYPE_SESSION,
- SOUP_SESSION_TLS_DATABASE, tlsdb,
- NULL);
- test_session_properties ("Session with non-NULL :tls-database", session,
- default_proxy_resolver, tlsdb);
- g_object_unref (tlsdb);
- g_object_unref (session);
+ /* g_tls_file_database_new() will fail with the dummy backend,
+ * so we can only do this test if we have a real TLS backend.
+ */
+ if (tls_available) {
+ tlsdb = g_tls_file_database_new (SRCDIR "/test-cert.pem", NULL);
+ session = g_object_new (SOUP_TYPE_SESSION,
+ SOUP_SESSION_TLS_DATABASE, tlsdb,
+ NULL);
+ test_session_properties ("Session with non-NULL :tls-database", session,
+ default_proxy_resolver, tlsdb);
+ g_object_unref (tlsdb);
+ g_object_unref (session);
+ }
session = g_object_new (SOUP_TYPE_SESSION,
SOUP_SESSION_SSL_USE_SYSTEM_CA_FILE, FALSE,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]