summaryrefslogtreecommitdiffstats
path: root/tests/auto/network/ssl/qsslserver/tst_qsslserver.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-11-11 16:26:04 +0100
committerMarc Mutz <marc.mutz@qt.io>2022-11-18 13:59:41 +0100
commit3a07c391847b81c7bf40d95fc4d7c49f63073abc (patch)
treeae481ec0170e6cd53cbd09a28fc780fe0ab467d2 /tests/auto/network/ssl/qsslserver/tst_qsslserver.cpp
parentc5f3c61469517a4ac00e4da01fe0bab9188c1488 (diff)
Port from qAsConst() to std::as_const()
We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace. This is a 6.4 re-run of the script we ran in dev, in order to avoid conflicts between the branches when cherry-picking. Change-Id: I5eca3df3179dfb2b2682c75a479ba9a4259cc703 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'tests/auto/network/ssl/qsslserver/tst_qsslserver.cpp')
-rw-r--r--tests/auto/network/ssl/qsslserver/tst_qsslserver.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/auto/network/ssl/qsslserver/tst_qsslserver.cpp b/tests/auto/network/ssl/qsslserver/tst_qsslserver.cpp
index 5170f2f8b7..13a3201345 100644
--- a/tests/auto/network/ssl/qsslserver/tst_qsslserver.cpp
+++ b/tests/auto/network/ssl/qsslserver/tst_qsslserver.cpp
@@ -241,13 +241,13 @@ void tst_QSslServer::testSelfSignedCertificateRejectedByServer()
// Check the sslErrorsSpy
const auto sslErrorsSpyErrors =
- qvariant_cast<QList<QSslError>>(qAsConst(server.sslErrorsSpy).first()[1]);
+ qvariant_cast<QList<QSslError>>(std::as_const(server.sslErrorsSpy).first()[1]);
QCOMPARE(sslErrorsSpyErrors.size(), 1);
QCOMPARE(sslErrorsSpyErrors.first().error(), certificateError);
// Check the peerVerifyErrorSpy
const auto peerVerifyErrorSpyError =
- qvariant_cast<QSslError>(qAsConst(server.peerVerifyErrorSpy).first()[1]);
+ qvariant_cast<QSslError>(std::as_const(server.peerVerifyErrorSpy).first()[1]);
QCOMPARE(peerVerifyErrorSpyError.error(), certificateError);
// Check client socket
@@ -302,7 +302,7 @@ void tst_QSslServer::testSelfSignedCertificateRejectedByClient()
QCOMPARE(server.startedEncryptionHandshakeSpy.size(), 1);
const auto errrOccuredSpyError = qvariant_cast<QAbstractSocket::SocketError>(
- qAsConst(server.errorOccurredSpy).first()[1]);
+ std::as_const(server.errorOccurredSpy).first()[1]);
QCOMPARE(errrOccuredSpyError, socketError);
} else {
// Client disconnected after connection accepted by server