DTLS auto-test(s) - fix a buggy logic with pending datagrams

Fixes: QTBUG-79128
Change-Id: Ifebd5b056541b7732b15b5cf063ad22ab754a64c
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This commit is contained in:
Timur Pocheptsov 2019-10-10 10:41:33 +02:00
parent 1fd2124de7
commit 28798478ba
2 changed files with 4 additions and 4 deletions

View File

@ -1131,7 +1131,7 @@ void tst_QDtls::handshakeReadyRead()
QUdpSocket *socket = qobject_cast<QUdpSocket *>(sender());
Q_ASSERT(socket);
if (!socket->pendingDatagramSize())
if (socket->pendingDatagramSize() <= 0)
return;
const bool isServer = socket == &serverSocket;

View File

@ -352,7 +352,7 @@ void tst_QDtlsCookie::receiveMessage(QUdpSocket *socket, QByteArray *message,
{
Q_ASSERT(socket && message);
if (!socket->pendingDatagramSize())
if (socket->pendingDatagramSize() <= 0)
testLoop.enterLoopMSecs(handshakeTimeoutMS);
QVERIFY(!testLoop.timeout());
@ -377,7 +377,7 @@ void tst_QDtlsCookie::serverReadyRead()
{
Q_ASSERT(clientsToWait);
if (!serverSocket.pendingDatagramSize())
if (serverSocket.pendingDatagramSize() <= 0)
return;
QByteArray hello;
@ -410,7 +410,7 @@ void tst_QDtlsCookie::clientReadyRead()
QUdpSocket *clientSocket = qobject_cast<QUdpSocket *>(sender());
Q_ASSERT(clientSocket);
if (!clientSocket->pendingDatagramSize())
if (clientSocket->pendingDatagramSize() <= 0)
return;
QDtls *handshake = nullptr;