summaryrefslogtreecommitdiffstats
path: root/tests/auto/network/socket/qudpsocket
diff options
context:
space:
mode:
authorTimur Pocheptsov <timur.pocheptsov@qt.io>2019-02-20 13:30:52 +0100
committerTimur Pocheptsov <timur.pocheptsov@qt.io>2019-02-21 11:14:48 +0000
commitd3eb9e944ac73f238b8716bb25b8051377bba946 (patch)
tree5c00e5cafd00ee878c0973d82731830910914605 /tests/auto/network/socket/qudpsocket
parent1d3a162bfe38f8a3cd576ca17ea7e0f71a55e074 (diff)
Make tst_QUdpSocket::lincLocalIPv6 less sadistic
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 <edward.welbourne@qt.io> Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'tests/auto/network/socket/qudpsocket')
-rw-r--r--tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp9
1 files changed, 4 insertions, 5 deletions
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