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:
parent
1fd2124de7
commit
28798478ba
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user