summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimur Pocheptsov <timur.pocheptsov@qt.io>2019-02-20 13:30:52 +0100
committerJani Heikkinen <jani.heikkinen@qt.io>2019-02-28 07:53:45 +0000
commit01f5d41a406b7baf1cb01692c870e5084fc11b1f (patch)
treea056276b20a8cbd44f55376611494c4031baac02
parent96f6cab22cab252cbe7a98bbeadde95497e0bd75 (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> (cherry picked from commit d3eb9e944ac73f238b8716bb25b8051377bba946) Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
-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