[glib-networking/wip/nacho/fix-libsoup-loop] connection: fix unit test to get the right error



commit b19bd36d14da1f46f417260bce3b55a4a5a8d716
Author: Ignacio Casal Quinteiro <qignacio amazon com>
Date:   Fri Mar 13 13:54:19 2020 +0100

    connection: fix unit test to get the right error

 tls/openssl/gtlsconnection-openssl.c | 3 ++-
 tls/tests/connection.c               | 5 -----
 2 files changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/tls/openssl/gtlsconnection-openssl.c b/tls/openssl/gtlsconnection-openssl.c
index fe77300..c019ec5 100644
--- a/tls/openssl/gtlsconnection-openssl.c
+++ b/tls/openssl/gtlsconnection-openssl.c
@@ -143,7 +143,8 @@ end_openssl_io (GTlsConnectionOpenssl  *openssl,
           reason == SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC ||
           reason == SSL_R_BAD_PROTOCOL_VERSION_NUMBER ||
           reason == SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE ||
-          reason == SSL_R_UNKNOWN_PROTOCOL)
+          reason == SSL_R_UNKNOWN_PROTOCOL ||
+          g_error_matches (my_error, G_IO_ERROR, G_IO_ERROR_BROKEN_PIPE))
         {
           g_clear_error (&my_error);
           g_set_error (error, G_TLS_ERROR, G_TLS_ERROR_NOT_TLS,
diff --git a/tls/tests/connection.c b/tls/tests/connection.c
index 21a150a..5b096f7 100644
--- a/tls/tests/connection.c
+++ b/tls/tests/connection.c
@@ -963,12 +963,7 @@ test_invalid_chain_with_alternative_ca_cert (TestConnection *test,
 
   g_assert_error (test->read_error, G_TLS_ERROR, G_TLS_ERROR_BAD_CERTIFICATE);
 
-#ifdef BACKEND_IS_GNUTLS
   g_assert_error (test->server_error, G_TLS_ERROR, G_TLS_ERROR_NOT_TLS);
-#elif defined(BACKEND_IS_OPENSSL)
-  /* FIXME: This is not OK. There should be an error here. */
-  g_assert_no_error (test->server_error);
-#endif
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]