summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@digia.com>2014-09-17 19:01:43 +0200
committerUlf Hermann <ulf.hermann@digia.com>2014-09-17 19:06:51 +0200
commit1fae8cb48c6d003681fbf521a0ed8c24c84bf9ad (patch)
tree350f581a0ef2cfddd1a57d1910879d9d24fd9eca
parent4fbb1ca1b549288c7e0659e0d3e59dd165cd1dc5 (diff)
Use QSignalSpy instead of waitFor in tst_qpacketprotocol
Our CI metrics tell us that this test is in much better shape in QtQuick2 than here. So let's apply the only differing change here, too. Change-Id: I1985f20ba36b94d698699173fb911e393b31c215 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
-rw-r--r--tests/auto/declarative/qpacketprotocol/tst_qpacketprotocol.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/auto/declarative/qpacketprotocol/tst_qpacketprotocol.cpp b/tests/auto/declarative/qpacketprotocol/tst_qpacketprotocol.cpp
index a8ab5b85..16c173d2 100644
--- a/tests/auto/declarative/qpacketprotocol/tst_qpacketprotocol.cpp
+++ b/tests/auto/declarative/qpacketprotocol/tst_qpacketprotocol.cpp
@@ -76,10 +76,14 @@ void tst_QPacketProtocol::init()
QVERIFY(m_server->listen(QHostAddress("127.0.0.1")));
m_client = new QTcpSocket(this);
+
+ QSignalSpy serverSpy(m_server, SIGNAL(newConnection()));
+ QSignalSpy clientSpy(m_client, SIGNAL(connected()));
+
m_client->connectToHost(m_server->serverAddress(), m_server->serverPort());
- QVERIFY(m_client->waitForConnected());
- QVERIFY(m_server->waitForNewConnection());
+ QVERIFY(clientSpy.count() > 0 || clientSpy.wait());
+ QVERIFY(serverSpy.count() > 0 || serverSpy.wait());
m_serverConn = m_server->nextPendingConnection();
}