summaryrefslogtreecommitdiffstats
path: root/tests/auto/network/socket/qlocalsocket
diff options
context:
space:
mode:
authorAlexander Akulich <akulichalexander@gmail.com>2020-02-07 16:31:55 +0300
committerAlexander Akulich <akulichalexander@gmail.com>2020-02-11 16:54:33 +0300
commitc034f92fc2e377f47a0f45efeb66905a0f45d0ae (patch)
treeb0f99e6d9de8e80a0e799fea815ed9ba3abe4de9 /tests/auto/network/socket/qlocalsocket
parent11dc7b35c8c3957bd19087a5e3ae7cfc4f1a3343 (diff)
Revert "QLocalSocket - deprecate ambiguous 'error' overloads"
This reverts commit 0de6c26ac17c90f513329fdbe87ef036fc25925a. 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: I67dbb5cada25da473bdd02e71b1e2d9bd03f039e Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'tests/auto/network/socket/qlocalsocket')
-rw-r--r--tests/auto/network/socket/qlocalsocket/socketprocess/main.cpp8
-rw-r--r--tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp8
2 files changed, 8 insertions, 8 deletions
diff --git a/tests/auto/network/socket/qlocalsocket/socketprocess/main.cpp b/tests/auto/network/socket/qlocalsocket/socketprocess/main.cpp
index 6355fea6ab..272e837ac5 100644
--- a/tests/auto/network/socket/qlocalsocket/socketprocess/main.cpp
+++ b/tests/auto/network/socket/qlocalsocket/socketprocess/main.cpp
@@ -65,8 +65,8 @@ bool runServer(int numberOfConnections)
return false;
}
printf("server: data written\n");
- if (socket->socketError() != QLocalSocket::UnknownSocketError) {
- fprintf(stderr, "server: socket error %d\n", socket->socketError());
+ if (socket->error() != QLocalSocket::UnknownSocketError) {
+ fprintf(stderr, "server: socket error %d\n", socket->error());
return false;
}
}
@@ -83,8 +83,8 @@ bool runClient()
socket.connectToServer(serverName, QLocalSocket::ReadWrite);
if (socket.waitForConnected())
break;
- if (socket.socketError() == QLocalSocket::ServerNotFoundError
- || socket.socketError() == QLocalSocket::ConnectionRefusedError) {
+ if (socket.error() == QLocalSocket::ServerNotFoundError
+ || socket.error() == QLocalSocket::ConnectionRefusedError) {
if (connectTimer.elapsed() > 5000) {
fprintf(stderr, "client: server not found or connection refused. Giving up.\n");
return false;
diff --git a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp
index 0c1536bd59..732f7eef00 100644
--- a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp
+++ b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp
@@ -195,7 +195,7 @@ private slots:
void slotError(QLocalSocket::LocalSocketError newError)
{
QVERIFY(errorString() != QLatin1String("Unknown error"));
- QCOMPARE(socketError(), newError);
+ QCOMPARE(error(), newError);
}
void slotStateChanged(QLocalSocket::LocalSocketState newState)
{
@@ -256,7 +256,7 @@ void tst_QLocalSocket::socket_basic()
QCOMPARE(socket.canReadLine(), false);
socket.close();
socket.disconnectFromServer();
- QCOMPARE(QLocalSocket::UnknownSocketError, socket.socketError());
+ QCOMPARE(QLocalSocket::UnknownSocketError, socket.error());
QVERIFY(!socket.errorString().isEmpty());
QCOMPARE(socket.flush(), false);
QCOMPARE(socket.isValid(), false);
@@ -375,13 +375,13 @@ void tst_QLocalSocket::listenAndConnect()
QVERIFY(socket->waitForConnected());
QVERIFY(socket->isValid());
QCOMPARE(socket->errorString(), QString("Unknown error"));
- QCOMPARE(socket->socketError(), QLocalSocket::UnknownSocketError);
+ QCOMPARE(socket->error(), QLocalSocket::UnknownSocketError);
QCOMPARE(socket->state(), QLocalSocket::ConnectedState);
//QVERIFY(socket->socketDescriptor() != -1);
QCOMPARE(spyError.count(), 0);
} else {
QVERIFY(!socket->errorString().isEmpty());
- QVERIFY(socket->socketError() != QLocalSocket::UnknownSocketError);
+ QVERIFY(socket->error() != QLocalSocket::UnknownSocketError);
QCOMPARE(socket->state(), QLocalSocket::UnconnectedState);
//QCOMPARE(socket->socketDescriptor(), -1);
QCOMPARE(qvariant_cast<QLocalSocket::LocalSocketError>(spyError.first()[0]),