qt 6.6.0 clean

This commit is contained in:
kleuter
2023-11-01 22:23:55 +01:00
parent 7b5ada15e7
commit 5d8194efa7
1449 changed files with 134276 additions and 31391 deletions

View File

@ -43,6 +43,8 @@
#include "private/qsslsocket_p.h"
#include "private/qsslconfiguration_p.h"
using namespace std::chrono_literals;
QT_WARNING_PUSH
QT_WARNING_DISABLE_DEPRECATED
// make these enum values available without causing deprecation warnings:
@ -2840,7 +2842,7 @@ void tst_QSslSocket::closeWhileEmittingSocketError()
// Make sure we have some data buffered so that close will try to flush:
clientSocket.write(QByteArray(1000000, Qt::Uninitialized));
QTestEventLoop::instance().enterLoopMSecs(1000);
QTestEventLoop::instance().enterLoop(1s);
QVERIFY(!QTestEventLoop::instance().timeout());
QCOMPARE(socketErrorSpy.size(), 1);
@ -3100,7 +3102,14 @@ void tst_QSslSocket::blacklistedCertificates()
QList<QSslError> sslErrors = receiver->sslHandshakeErrors();
QVERIFY(sslErrors.size() > 0);
// there are more errors (self signed cert and hostname mismatch), but we only care about the blacklist error
QCOMPARE(sslErrors.at(0).error(), QSslError::CertificateBlacklisted);
std::optional<QSslError> blacklistedError;
for (const QSslError &error : sslErrors) {
if (error.error() == QSslError::CertificateBlacklisted) {
blacklistedError = error;
break;
}
}
QVERIFY2(blacklistedError, "CertificateBlacklisted error not found!");
}
void tst_QSslSocket::versionAccessors()
@ -4577,7 +4586,7 @@ void tst_QSslSocket::unsupportedProtocols()
return;
QFETCH(const QSsl::SslProtocol, unsupportedProtocol);
const int timeoutMS = 500;
constexpr auto timeout = 500ms;
// Test a client socket.
{
// 0. connectToHostEncrypted: client-side, non-blocking API, error is discovered
@ -4599,7 +4608,7 @@ void tst_QSslSocket::unsupportedProtocols()
QCOMPARE(socket.error(), QAbstractSocket::UnknownSocketError);
socket.connectToHost(QHostAddress::LocalHost, server.serverPort());
QVERIFY(socket.waitForConnected(timeoutMS));
QVERIFY(socket.waitForConnected(int(timeout.count())));
socket.setProtocol(unsupportedProtocol);
socket.startClientEncryption();
@ -4624,7 +4633,7 @@ void tst_QSslSocket::unsupportedProtocols()
QTcpSocket client;
client.connectToHost(QHostAddress::LocalHost, server.serverPort());
loop.enterLoopMSecs(timeoutMS);
loop.enterLoop(timeout);
QVERIFY(!loop.timeout());
QVERIFY(server.socket);
QCOMPARE(server.socket->error(), QAbstractSocket::SslInvalidUserDataError);
@ -4731,7 +4740,7 @@ void tst_QSslSocket::alertMissingCertificate()
connect(&clientSocket, &QAbstractSocket::errorOccurred, earlyQuitter);
connect(&server, &SslServer::socketError, earlyQuitter);
runner.enterLoopMSecs(1000);
runner.enterLoop(1s);
if (clientSocket.isEncrypted()) {
// When using TLS 1.3 the client side thinks it is connected very
@ -4739,7 +4748,7 @@ void tst_QSslSocket::alertMissingCertificate()
// inevitable disconnect.
QCOMPARE(clientSocket.sessionProtocol(), QSsl::TlsV1_3);
connect(&clientSocket, &QSslSocket::disconnected, &runner, &QTestEventLoop::exitLoop);
runner.enterLoopMSecs(10000);
runner.enterLoop(10s);
}
QVERIFY(serverSpy.size() > 0);
@ -4794,7 +4803,7 @@ void tst_QSslSocket::alertInvalidCertificate()
connect(&clientSocket, &QAbstractSocket::errorOccurred, earlyQuitter);
connect(&server, &SslServer::socketError, earlyQuitter);
runner.enterLoopMSecs(1000);
runner.enterLoop(1s);
QVERIFY(serverSpy.size() > 0);
QVERIFY(clientSpy.size() > 0);
@ -4922,7 +4931,7 @@ void tst_QSslSocket::selfSignedCertificates()
connect(&clientSocket, &QAbstractSocket::errorOccurred, earlyQuitter);
connect(&server, &SslServer::socketError, earlyQuitter);
runner.enterLoopMSecs(1000);
runner.enterLoop(1s);
if (clientKnown) {
QCOMPARE(serverSpy.size(), 0);
@ -5060,7 +5069,7 @@ void tst_QSslSocket::pskHandshake()
connect(&clientSocket, &QAbstractSocket::errorOccurred, earlyQuitter);
connect(&server, &SslServer::socketError, earlyQuitter);
runner.enterLoopMSecs(1000);
runner.enterLoop(1s);
if (pskRight) {
QCOMPARE(serverSpy.size(), 0);