diff options
author | Alexander Akulich <akulichalexander@gmail.com> | 2020-02-07 16:43:07 +0300 |
---|---|---|
committer | Alexander Akulich <akulichalexander@gmail.com> | 2020-02-26 23:07:52 +0300 |
commit | 6d18e4a2b8d82519df177bff5a86a8eca5dae9e6 (patch) | |
tree | ccb1462a3c60f802e4b4f72cb1900212217e2084 /tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp | |
parent | e1920f65936fe7d712441e88c023746ab5c21cee (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/socket/qudpsocket/tst_qudpsocket.cpp')
-rw-r--r-- | tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp index 88898cd8a8..0f419e9de4 100644 --- a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp +++ b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp @@ -337,7 +337,7 @@ void tst_QUdpSocket::constructing() QCOMPARE(socket.canReadLine(), false); QCOMPARE(socket.readLine(), QByteArray()); QCOMPARE(socket.socketDescriptor(), (qintptr)-1); - QCOMPARE(socket.socketError(), QUdpSocket::UnknownSocketError); + QCOMPARE(socket.error(), QUdpSocket::UnknownSocketError); QCOMPARE(socket.errorString(), QString("Unknown error")); // Check the state of the socket api @@ -575,7 +575,7 @@ void tst_QUdpSocket::ipv6Loop() int paulPort; if (!peter.bind(QHostAddress(QHostAddress::LocalHostIPv6), 0)) { - QCOMPARE(peter.socketError(), QUdpSocket::UnsupportedSocketOperationError); + QCOMPARE(peter.error(), QUdpSocket::UnsupportedSocketOperationError); return; } @@ -897,7 +897,7 @@ void tst_QUdpSocket::writeDatagram() QCOMPARE(errorspy.count(), 1); QCOMPARE(*static_cast<const int *>(errorspy.at(0).at(0).constData()), int(QUdpSocket::DatagramTooLargeError)); - QCOMPARE(client.socketError(), QUdpSocket::DatagramTooLargeError); + QCOMPARE(client.error(), QUdpSocket::DatagramTooLargeError); break; } QCOMPARE(bytesspy.count(), 1); @@ -1054,14 +1054,14 @@ void tst_QUdpSocket::writeToNonExistingPeer() // the second one should fail! QTest::qSleep(1000); // do not process events QCOMPARE(sConnected.write("", 1), qint64(-1)); - QCOMPARE(int(sConnected.socketError()), int(QUdpSocket::ConnectionRefusedError)); + QCOMPARE(int(sConnected.error()), int(QUdpSocket::ConnectionRefusedError)); // the third one will succeed... QCOMPARE(sConnected.write("", 1), qint64(1)); QTestEventLoop::instance().enterLoop(1); QCOMPARE(sConnectedReadyReadSpy.count(), 0); QCOMPARE(sConnectedErrorSpy.count(), 1); - QCOMPARE(int(sConnected.socketError()), int(QUdpSocket::ConnectionRefusedError)); + QCOMPARE(int(sConnected.error()), int(QUdpSocket::ConnectionRefusedError)); // we should now get a read error QCOMPARE(sConnected.write("", 1), qint64(1)); @@ -1071,12 +1071,12 @@ void tst_QUdpSocket::writeToNonExistingPeer() QCOMPARE(sConnected.bytesAvailable(), Q_INT64_C(0)); QCOMPARE(sConnected.pendingDatagramSize(), Q_INT64_C(-1)); QCOMPARE(sConnected.readDatagram(buf, 2), Q_INT64_C(-1)); - QCOMPARE(int(sConnected.socketError()), int(QUdpSocket::ConnectionRefusedError)); + QCOMPARE(int(sConnected.error()), int(QUdpSocket::ConnectionRefusedError)); QCOMPARE(sConnected.write("", 1), qint64(1)); QTest::qSleep(1000); // do not process events QCOMPARE(sConnected.read(buf, 2), Q_INT64_C(0)); - QCOMPARE(int(sConnected.socketError()), int(QUdpSocket::ConnectionRefusedError)); + QCOMPARE(int(sConnected.error()), int(QUdpSocket::ConnectionRefusedError)); // we should still be connected QCOMPARE(int(sConnected.state()), int(QUdpSocket::ConnectedState)); |