From 1fae8cb48c6d003681fbf521a0ed8c24c84bf9ad Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Wed, 17 Sep 2014 19:01:43 +0200 Subject: 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 --- tests/auto/declarative/qpacketprotocol/tst_qpacketprotocol.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'tests/auto/declarative') 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(); } -- cgit v1.2.3