Assert after waiting and not before

This commit is contained in:
Albert Vaca Cintora 2019-03-14 14:27:34 +01:00
parent d72e4a1131
commit ad21af639f

View file

@ -101,11 +101,11 @@ void TestSslSocketLineReader::testTrustedDevice()
{ {
int maxAttemps = 5; int maxAttemps = 5;
QCOMPARE(true, m_server->hasPendingConnections());
while(!m_server->hasPendingConnections() && maxAttemps > 0) { while(!m_server->hasPendingConnections() && maxAttemps > 0) {
--maxAttemps; --maxAttemps;
QTest::qSleep(1000); QTest::qSleep(1000);
} }
QCOMPARE(true, m_server->hasPendingConnections());
QSslSocket* serverSocket = m_server->nextPendingConnection(); QSslSocket* serverSocket = m_server->nextPendingConnection();
@ -171,11 +171,11 @@ void TestSslSocketLineReader::testTrustedDevice()
void TestSslSocketLineReader::testUntrustedDevice() void TestSslSocketLineReader::testUntrustedDevice()
{ {
int maxAttemps = 5; int maxAttemps = 5;
QCOMPARE(true, m_server->hasPendingConnections());
while(!m_server->hasPendingConnections() && maxAttemps > 0) { while(!m_server->hasPendingConnections() && maxAttemps > 0) {
--maxAttemps; --maxAttemps;
QTest::qSleep(1000); QTest::qSleep(1000);
} }
QCOMPARE(true, m_server->hasPendingConnections());
QSslSocket* serverSocket = m_server->nextPendingConnection(); QSslSocket* serverSocket = m_server->nextPendingConnection();
@ -242,6 +242,7 @@ void TestSslSocketLineReader::testTrustedDeviceWithWrongCertificate()
--maxAttemps; --maxAttemps;
QTest::qSleep(1000); QTest::qSleep(1000);
} }
QCOMPARE(true, m_server->hasPendingConnections());
QSslSocket* serverSocket = m_server->nextPendingConnection(); QSslSocket* serverSocket = m_server->nextPendingConnection();