[glib-networking/mcatanzaro/client-auth-request-fail: 1/2] tests: test_client_auth_request_fail() should expect G_FILE_ERROR_ACCES



commit 82066b74d31f0eccf1583357245de4f3fee78032
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Fri May 17 11:21:36 2019 -0500

    tests: test_client_auth_request_fail() should expect G_FILE_ERROR_ACCES
    
    The FIXME is wrong. I misunderstood the purpose of this test when adding
    the FIXME. The point of the test is to see what happens when the
    GTlsInteraction's certificate request fails. Our mock request uses
    G_FILE_ERROR_ACCES in this case, so that's the error we should expect.
    
    We spent some time today on IRC trying to debug why we were getting
    G_TLS_CERTIFICATE_ERROR instead for GnuTLS. Turns out, we're not. The
    preprocessor guard is just misleading. OPENSSL_VERSION_NUMBER is not
    defined when compiling for GnuTLS, so that turns into 0, and 0 <
    0x10101000L, so we actually are building the first case here, not the
    second. Whoops!

 tls/tests/connection.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/tls/tests/connection.c b/tls/tests/connection.c
index 6397115..9c9d7f3 100644
--- a/tls/tests/connection.c
+++ b/tls/tests/connection.c
@@ -1259,13 +1259,10 @@ test_client_auth_request_fail (TestConnection *test,
   g_main_loop_run (test->loop);
   wait_until_server_finished (test);
 
-#if OPENSSL_VERSION_NUMBER < 0x10101000L || defined (LIBRESSL_VERSION_NUMBER)
-  /* FIXME: G_FILE_ERROR_ACCES is not a very great error to get here. */
+  /* G_FILE_ERROR_ACCES is the error returned by our mock interaction object
+   * when the GTlsInteraction's certificate request fails.
+   */
   g_assert_error (test->read_error, G_FILE_ERROR, G_FILE_ERROR_ACCES);
-#else
-  g_assert_error (test->read_error, G_TLS_ERROR, G_TLS_ERROR_CERTIFICATE_REQUIRED);
-#endif
-
   g_assert_error (test->server_error, G_TLS_ERROR, G_TLS_ERROR_CERTIFICATE_REQUIRED);
 
   g_io_stream_close (test->server_connection, NULL, NULL);


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