aboutsummaryrefslogtreecommitdiff
path: root/tests/qxmppsocks/tst_qxmppsocks.cpp
diff options
context:
space:
mode:
authorJBB <jbb.prv@gmx.de>2020-01-20 00:19:38 +0100
committerLNJ <lnj@kaidan.im>2020-01-20 00:19:38 +0100
commit8557bc3a605e5d2b1a7dae5999501b19c1c99b58 (patch)
treef17fefa61a26e01c99884c7d3e458b8ea70b181b /tests/qxmppsocks/tst_qxmppsocks.cpp
parentcccb7675e0eb9d411c736d1ff3f189fb75ef33dd (diff)
downloadqxmpp-8557bc3a605e5d2b1a7dae5999501b19c1c99b58.tar.gz
Port majority of old-style connects (#237)
This provides more type safety and is future-proof.
Diffstat (limited to 'tests/qxmppsocks/tst_qxmppsocks.cpp')
-rw-r--r--tests/qxmppsocks/tst_qxmppsocks.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/tests/qxmppsocks/tst_qxmppsocks.cpp b/tests/qxmppsocks/tst_qxmppsocks.cpp
index f29f60e1..9861891c 100644
--- a/tests/qxmppsocks/tst_qxmppsocks.cpp
+++ b/tests/qxmppsocks/tst_qxmppsocks.cpp
@@ -102,7 +102,7 @@ void tst_QXmppSocks::testClient()
QXmppSocksClient client("127.0.0.1", server.serverPort());
QEventLoop loop;
- connect(&server, SIGNAL(newConnection()), &loop, SLOT(quit()));
+ connect(&server, &QTcpServer::newConnection, &loop, &QEventLoop::quit);
client.connectToHost("www.google.com", 80);
loop.exec();
@@ -111,8 +111,8 @@ void tst_QXmppSocks::testClient()
m_connectionSocket = server.nextPendingConnection();
QVERIFY(m_connectionSocket);
- connect(m_connectionSocket, SIGNAL(disconnected()), &loop, SLOT(quit()));
- connect(m_connectionSocket, SIGNAL(readyRead()), &loop, SLOT(quit()));
+ connect(m_connectionSocket, &QAbstractSocket::disconnected, &loop, &QEventLoop::quit);
+ connect(m_connectionSocket, &QIODevice::readyRead, &loop, &QEventLoop::quit);
loop.exec();
QCOMPARE(client.state(), QAbstractSocket::ConnectedState);
QCOMPARE(m_connectionSocket->state(), QAbstractSocket::ConnectedState);
@@ -132,7 +132,7 @@ void tst_QXmppSocks::testClient()
QCOMPARE(m_connectionSocket->readAll(), QByteArray::fromHex("050100030e7777772e676f6f676c652e636f6d0050"));
// wait for client to be ready
- connect(&client, SIGNAL(ready()), &loop, SLOT(quit()));
+ connect(&client, &QXmppSocksClient::ready, &loop, &QEventLoop::quit);
m_connectionSocket->write(serverConnect);
loop.exec();
if (!serverConnectWorks) {
@@ -155,13 +155,13 @@ void tst_QXmppSocks::testClientAndServer()
QXmppSocksServer server;
QVERIFY(server.listen());
QVERIFY(server.serverPort() != 0);
- connect(&server, SIGNAL(newConnection(QTcpSocket*,QString,quint16)),
- this, SLOT(newConnectionSlot(QTcpSocket*,QString,quint16)));
+ connect(&server, &QXmppSocksServer::newConnection,
+ this, &tst_QXmppSocks::newConnectionSlot);
QXmppSocksClient client("127.0.0.1", server.serverPort());
QEventLoop loop;
- connect(&client, SIGNAL(ready()), &loop, SLOT(quit()));
+ connect(&client, &QXmppSocksClient::ready, &loop, &QEventLoop::quit);
client.connectToHost("www.google.com", 80);
loop.exec();
@@ -217,16 +217,16 @@ void tst_QXmppSocks::testServer()
QXmppSocksServer server;
QVERIFY(server.listen());
QVERIFY(server.serverPort() != 0);
- connect(&server, SIGNAL(newConnection(QTcpSocket*,QString,quint16)),
- this, SLOT(newConnectionSlot(QTcpSocket*,QString,quint16)));
+ connect(&server, &QXmppSocksServer::newConnection,
+ this, &tst_QXmppSocks::newConnectionSlot);
QTcpSocket client;
client.connectToHost(QHostAddress::LocalHost, server.serverPort());
QVERIFY2(client.waitForConnected(), qPrintable(client.errorString()));
QEventLoop loop;
- connect(&client, SIGNAL(disconnected()), &loop, SLOT(quit()));
- connect(&client, SIGNAL(readyRead()), &loop, SLOT(quit()));
+ connect(&client, &QAbstractSocket::disconnected, &loop, &QEventLoop::quit);
+ connect(&client, &QIODevice::readyRead, &loop, &QEventLoop::quit);
// send client handshake
client.write(clientHandshake);