tst_qnetworkreply: localhost may resolve to ipv4 and 6
On some platforms, localhost resolves to both ipv4 and ipv6 addresses. In that case we might get multiple emissions of the socketStartedConnecting signal, for Happy Eyeballs. Change-Id: Ib39a167bdde2089106c89a3e297cbb0ad2f357d9 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit 13a0f294b5ef2ec8a2057d72365f989ddf6290de) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 6e98673846b3a5e992f7220b4e0f1b4ecfb9cdaa) (cherry picked from commit ff909d8b4cb1d423fd51412564d12b4e4d999794) Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
parent
5fb73f8dc9
commit
c7ba485b35
@ -9993,7 +9993,14 @@ void tst_QNetworkReply::moreActivitySignals()
|
||||
QSignalSpy spy3(reply.data(), SIGNAL(metaDataChanged()));
|
||||
QSignalSpy spy4(reply.data(), SIGNAL(finished()));
|
||||
spy1.wait();
|
||||
QCOMPARE(spy1.size(), 1);
|
||||
if (url.host() == u"localhost") {
|
||||
// localhost may resolve to both v4 and v6, so we may get two
|
||||
// socketStartedConnecting signals
|
||||
QCOMPARE_GE(spy1.size(), 1);
|
||||
QCOMPARE_LE(spy1.size(), 2);
|
||||
} else {
|
||||
QCOMPARE(spy1.size(), 1);
|
||||
}
|
||||
spy2.wait();
|
||||
QCOMPARE(spy2.size(), 1);
|
||||
spy3.wait();
|
||||
|
Loading…
x
Reference in New Issue
Block a user