[glib-networking] Improve how tests check for the TLS backend



commit 7bd16d52035a1747f88a66b62d9c5bb398c2abcf
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Sun Jul 14 13:45:22 2019 -0500

    Improve how tests check for the TLS backend
    
    There should be a compiler warning here when building OpenSSL, because
    we check the value of an undefined preprocessor macro,
    BACKEND_IS_GNUTLS.

 tls/tests/connection.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/tls/tests/connection.c b/tls/tests/connection.c
index 31aaa1c..13aa45a 100644
--- a/tls/tests/connection.c
+++ b/tls/tests/connection.c
@@ -948,7 +948,7 @@ test_invalid_chain_with_alternative_ca_cert (TestConnection *test,
 
 #ifdef BACKEND_IS_GNUTLS
   g_assert_error (test->server_error, G_TLS_ERROR, G_TLS_ERROR_NOT_TLS);
-#elif BACKEND_IS_OPENSSL
+#elif defined(BACKEND_IS_OPENSSL)
   /* FIXME: This is not OK. There should be an error here. */
   g_assert_no_error (test->server_error);
 #endif
@@ -1375,9 +1375,9 @@ test_failed_connection (TestConnection *test,
 
   g_assert_error (test->read_error, G_TLS_ERROR, G_TLS_ERROR_BAD_CERTIFICATE);
 
-#if BACKEND_IS_GNUTLS
+#ifdef BACKEND_IS_GNUTLS
   g_assert_error (test->server_error, G_TLS_ERROR, G_TLS_ERROR_NOT_TLS);
-#elif BACKEND_IS_OPENSSL
+#elif defined(BACKEND_IS_OPENSSL)
   /* FIXME: This is not OK. There should be an error here. */
   g_assert_no_error (test->server_error);
 #endif


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