Details
-
Suggestion
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
None
-
None
Description
It would be preferential to increase correctness of some tests by having the ability to wait for multiple signals simultaneously.
MyServer server("localhost", 8888); server.listen(); MyClient client ("localhost", 8888); client.connect(); QSignalSpy server_spy(&server, &MyServer::newClient)); QSignalSpy client_spy(&client, &MyClient::connected)); //Wrong, but will mostly work => flaky tests QVERIFY(server_spy.wait()); QCOPMARE(client_spy.count(), 1); //Correct, but very verbose QVERIFY(server_spy.wait()); if(client_spy.count() != 0) QVERIFY(client_spy.wait()); //Future QVERIFY(qWaitAll(client_spy, server_spy))
Otherwise it will lead to flaky tests, because people keep forgetting that the other signal might not be delivered yet when QueuedConnection is used. Eg. because of Threads