summaryrefslogtreecommitdiffstats
path: root/tests/auto/network/ssl/qsslsocket
diff options
context:
space:
mode:
authorAlexander Akulich <akulichalexander@gmail.com>2020-02-07 16:43:07 +0300
committerAlexander Akulich <akulichalexander@gmail.com>2020-02-26 23:07:52 +0300
commit6d18e4a2b8d82519df177bff5a86a8eca5dae9e6 (patch)
treeccb1462a3c60f802e4b4f72cb1900212217e2084 /tests/auto/network/ssl/qsslsocket
parente1920f65936fe7d712441e88c023746ab5c21cee (diff)
Revert "QAbstractSocket: deprecate 'error' member-function"
This reverts commit 94b3dd77f29a00ebbd1efdc66d75f57e1c75b152. The patch fixes ambiguity between a getter and a signal by changing the getter name, but we still have to rename the signal to follow the signals naming convention. Revert the commit to keep the getter as is and change the signal name instead. Change-Id: I0dd60cf1ae9d1bd95beeb8ad58661ca4b1fb63b9 Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/network/ssl/qsslsocket')
-rw-r--r--tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
index e0364c7155..cf383afd8b 100644
--- a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
+++ b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
@@ -527,7 +527,7 @@ void tst_QSslSocket::constructing()
QCOMPARE(socket.write(0, 0), qint64(-1));
QTest::ignoreMessage(QtWarningMsg, writeNotOpenMessage);
QCOMPARE(socket.write(QByteArray()), qint64(-1));
- QCOMPARE(socket.socketError(), QAbstractSocket::UnknownSocketError);
+ QCOMPARE(socket.error(), QAbstractSocket::UnknownSocketError);
QVERIFY(!socket.flush());
QVERIFY(!socket.isValid());
QCOMPARE(socket.localAddress(), QHostAddress());
@@ -1390,16 +1390,16 @@ void tst_QSslSocket::protocolServerSide()
QAbstractSocket::SocketState expectedState = (works) ? QAbstractSocket::ConnectedState : QAbstractSocket::UnconnectedState;
// Determine whether the client or the server caused the event loop
// to quit due to a socket error, and investigate the culprit.
- if (client.socketError() != QAbstractSocket::UnknownSocketError) {
+ if (client.error() != QAbstractSocket::UnknownSocketError) {
// It can happen that the client, after TCP connection established, before
// incomingConnection() slot fired, hits TLS initialization error and stops
// the loop, so the server socket is not created yet.
if (server.socket)
- QVERIFY(server.socket->socketError() == QAbstractSocket::UnknownSocketError);
+ QVERIFY(server.socket->error() == QAbstractSocket::UnknownSocketError);
QCOMPARE(client.state(), expectedState);
- } else if (server.socket->socketError() != QAbstractSocket::UnknownSocketError) {
- QVERIFY(client.socketError() == QAbstractSocket::UnknownSocketError);
+ } else if (server.socket->error() != QAbstractSocket::UnknownSocketError) {
+ QVERIFY(client.error() == QAbstractSocket::UnknownSocketError);
QCOMPARE(server.socket->state(), expectedState);
}
@@ -2011,7 +2011,7 @@ void tst_QSslSocket::setEmptyKey()
QTestEventLoop::instance().enterLoop(2);
QCOMPARE(socket.state(), QAbstractSocket::ConnectedState);
- QCOMPARE(socket.socketError(), QAbstractSocket::UnknownSocketError);
+ QCOMPARE(socket.error(), QAbstractSocket::UnknownSocketError);
}
void tst_QSslSocket::spontaneousWrite()
@@ -2783,11 +2783,11 @@ void tst_QSslSocket::writeBigChunk()
// no better way to do this right now since the error is the same as the default error.
if (socket->errorString().startsWith(QLatin1String("Unable to write data")))
{
- qWarning() << socket->socketError() << socket->errorString();
+ qWarning() << socket->error() << socket->errorString();
QFAIL("Error while writing! Check if the OpenSSL BIO size is limited?!");
}
// also check the error string. If another error (than UnknownError) occurred, it should be different than before
- QVERIFY2(errorBefore == errorAfter || socket->socketError() == QAbstractSocket::RemoteHostClosedError,
+ QVERIFY2(errorBefore == errorAfter || socket->error() == QAbstractSocket::RemoteHostClosedError,
QByteArray("unexpected error: ").append(qPrintable(errorAfter)));
// check that everything has been written to OpenSSL
@@ -2982,7 +2982,7 @@ void tst_QSslSocket::resume()
QCOMPARE(encryptedSpy.count(), 0);
QVERIFY(!socket.isEncrypted());
QCOMPARE(errorSpy.count(), 1);
- QCOMPARE(socket.socketError(), QAbstractSocket::SslHandshakeFailedError);
+ QCOMPARE(socket.error(), QAbstractSocket::SslHandshakeFailedError);
}
}
@@ -4347,9 +4347,9 @@ void tst_QSslSocket::disabledProtocols()
// early, preventing any real connection from ever starting.
QSslSocket socket;
socket.setProtocol(disabledProtocol);
- QCOMPARE(socket.socketError(), QAbstractSocket::UnknownSocketError);
+ QCOMPARE(socket.error(), QAbstractSocket::UnknownSocketError);
socket.connectToHostEncrypted(QStringLiteral("doesnotmatter.org"), 1010);
- QCOMPARE(socket.socketError(), QAbstractSocket::SslInvalidUserDataError);
+ QCOMPARE(socket.error(), QAbstractSocket::SslInvalidUserDataError);
QCOMPARE(socket.state(), QAbstractSocket::UnconnectedState);
}
{
@@ -4359,14 +4359,14 @@ void tst_QSslSocket::disabledProtocols()
QVERIFY(server.listen());
QSslSocket socket;
- QCOMPARE(socket.socketError(), QAbstractSocket::UnknownSocketError);
+ QCOMPARE(socket.error(), QAbstractSocket::UnknownSocketError);
socket.connectToHost(QHostAddress::LocalHost, server.serverPort());
QVERIFY(socket.waitForConnected(timeoutMS));
socket.setProtocol(disabledProtocol);
socket.startClientEncryption();
- QCOMPARE(socket.socketError(), QAbstractSocket::SslInvalidUserDataError);
+ QCOMPARE(socket.error(), QAbstractSocket::SslInvalidUserDataError);
}
{
// 2. waitForEncrypted: client-side, blocking API plus requires from us
@@ -4390,7 +4390,7 @@ void tst_QSslSocket::disabledProtocols()
loop.enterLoopMSecs(timeoutMS);
QVERIFY(!loop.timeout());
QVERIFY(server.socket);
- QCOMPARE(server.socket->socketError(), QAbstractSocket::SslInvalidUserDataError);
+ QCOMPARE(server.socket->error(), QAbstractSocket::SslInvalidUserDataError);
}
}