QmlProfiler: Relax client manager test

We can actually get several TCP connection attempts from the client
manager. That is the whole point of retrying. The QQmlDebugServer
explicitly allows sequential connections, so we should allow them, too.

Change-Id: Id38290dbfd86fadfb0c648189f89827330ea1174
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Ulf Hermann
2016-07-26 08:54:04 +02:00
parent e67cb6d521
commit 3a9e459408

View File

@@ -183,7 +183,7 @@ void QmlProfilerClientManagerTest::testUnresponsiveTcp()
clientManager.setTcpConnection(hostName, port);
clientManager.connectToTcpServer();
QTRY_COMPARE(connectionSpy.count(), 1);
QTRY_VERIFY(connectionSpy.count() > 0);
QTRY_COMPARE(failedSpy.count(), 1);
QCOMPARE(openedSpy.count(), 0);
QCOMPARE(closedSpy.count(), 0);
@@ -271,7 +271,6 @@ void QmlProfilerClientManagerTest::testResponsiveTcp()
QTcpServer server;
QScopedPointer<QTcpSocket> socket;
connect(&server, &QTcpServer::newConnection, [&server, &socket]() {
QVERIFY(socket.isNull());
socket.reset(server.nextPendingConnection());
fakeDebugServer(socket.data());
});