From d3eb9e944ac73f238b8716bb25b8051377bba946 Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Wed, 20 Feb 2019 13:30:52 +0100 Subject: Make tst_QUdpSocket::lincLocalIPv6 less sadistic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It fails on CI (Windows 10). Given our qabstractsocket disables read notifications/stops emitting readyRead if it already has pending data (unbuffered, aka UDP socket type) - make sure we do not suffer from this. The change does not affect the test's logic (unless the logic was to fail), it just makes it more fail-proof. Change-Id: I6c9b7ded20478f675260872a2a7032b4f356f197 Fixes: QTBUG-73884 Reviewed-by: Edward Welbourne Reviewed-by: MÃ¥rten Nordheim --- tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp') diff --git a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp index 8ebb27e58c..707c1acf48 100644 --- a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp +++ b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp @@ -1640,15 +1640,14 @@ void tst_QUdpSocket::linkLocalIPv6() sockets << s; } - QUdpSocket neutral; - QVERIFY(neutral.bind(QHostAddress(QHostAddress::AnyIPv6))); - QSignalSpy neutralReadSpy(&neutral, SIGNAL(readyRead())); - QByteArray testData("hello"); foreach (QUdpSocket *s, sockets) { + QUdpSocket neutral; + QVERIFY(neutral.bind(QHostAddress(QHostAddress::AnyIPv6))); + QSignalSpy neutralReadSpy(&neutral, SIGNAL(readyRead())); + QSignalSpy spy(s, SIGNAL(readyRead())); - neutralReadSpy.clear(); QVERIFY(s->writeDatagram(testData, s->localAddress(), neutral.localPort())); QTRY_VERIFY(neutralReadSpy.count() > 0); //note may need to accept a firewall prompt -- cgit v1.2.3