From 4d3f5ac0cc731a1120154f707bceb57eb4ddabe2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Mon, 31 Oct 2022 15:13:04 +0100 Subject: QHostAddress: Fix incorrect comparison against 'Any' When 'this' is IPv6 and 'other' is Any then there is no point in testing 'other's IPv6 address. Added extra tests against QHostAddress::Any*. Pick-to: 6.4 6.2 5.15 Fixes: QTBUG-108103 Change-Id: I09f32b1b147b1ec8380546c91cd89684a6bebe2e Reviewed-by: Thiago Macieira --- tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/auto/network/socket') diff --git a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp index b241f735b7..22d24ed448 100644 --- a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp +++ b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp @@ -628,7 +628,7 @@ void tst_QUdpSocket::dualStack() QCOMPARE(dgram.senderAddress(), makeNonAny(v4Sock.localAddress(), QHostAddress::Null)); if (dgram.destinationPort() != -1) { QCOMPARE(dgram.destinationPort(), int(dualSock.localPort())); - QVERIFY(dgram.destinationAddress().isEqual(dualSock.localAddress())); + QVERIFY(dgram.destinationAddress().isEqual(makeNonAny(dualSock.localAddress(), QHostAddress::LocalHost))); } else { qInfo("Getting IPv4 destination address failed."); } -- cgit v1.2.3