From 9c67aa2da1fa8c0c1ec347ac43d0aabf1a35b429 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Wed, 14 Jul 2021 15:58:08 +0200 Subject: tst_QSslSocket: fix and clean up allowedProtocolNegotiation The server's socket may not have been created yet, so use the server's signal instead. Switch to QCOMPARE to get better output. Delete the extra checking for schannel, we don't support Windows 8 anymore. Pick-to: 6.2 Change-Id: Icd310c32939cb577c9f3438789f667aa0a3a4d85 Reviewed-by: Edward Welbourne --- tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp index c53b0385d1..105a6884a8 100644 --- a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp +++ b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp @@ -3800,12 +3800,6 @@ void tst_QSslSocket::allowedProtocolNegotiation() if (!hasServerAlpn) QSKIP("Server-side ALPN is unsupported, skipping test"); - if (isTestingSchannel) { - // TODO: move this check into the plugin (not to report ALPN as supported). - if (QOperatingSystemVersion::current() < QOperatingSystemVersion::Windows8_1) - QSKIP("ALPN is not supported on this version of Windows using Schannel."); - } - QFETCH_GLOBAL(bool, setProxy); if (setProxy) return; @@ -3840,13 +3834,13 @@ void tst_QSslSocket::allowedProtocolNegotiation() loop.exit(); }; connect(&clientSocket, &QSslSocket::encrypted, &loop, earlyQuitter); - connect(server.socket, &QSslSocket::encrypted, &loop, earlyQuitter); + connect(&server, &SslServer::socketEncrypted, &loop, earlyQuitter); loop.exec(); - QVERIFY(server.socket->sslConfiguration().nextNegotiatedProtocol() == - clientSocket.sslConfiguration().nextNegotiatedProtocol()); - QVERIFY(server.socket->sslConfiguration().nextNegotiatedProtocol() == expectedNegotiated); + QCOMPARE(server.socket->sslConfiguration().nextNegotiatedProtocol(), + clientSocket.sslConfiguration().nextNegotiatedProtocol()); + QCOMPARE(server.socket->sslConfiguration().nextNegotiatedProtocol(), expectedNegotiated); } #if QT_CONFIG(openssl) -- cgit v1.2.3