summaryrefslogtreecommitdiffstats
path: root/tests/auto/network
diff options
context:
space:
mode:
authorAxel Spoerl <axel.spoerl@qt.io>2024-01-02 21:54:02 +0100
committerAxel Spoerl <axel.spoerl@qt.io>2024-01-11 10:59:03 +0100
commit3c5e37fe0ff761bd4ee4eeea67881ec7b8eadad5 (patch)
tree074b47d9bde678e23b14ff5948dd411cd11baab3 /tests/auto/network
parent74d61ed2da9d6f3eceb550facaa179e8f22c7c64 (diff)
tst_QHostInfo::reverseLookup(): code cleanup
Remove redundant curly braces. Use constFirst() instead of first() on a temporary list object. Task-number: QTBUG-120460 Pick-to: 6.7 6.6 6.5 Change-Id: Id643b20dfa5a541fea56abfdbcf933245a8a3c9d Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/network')
-rw-r--r--tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp b/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp
index 195cf972d9..b81ead7e80 100644
--- a/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp
+++ b/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp
@@ -440,9 +440,8 @@ void tst_QHostInfo::reverseLookup()
QFETCH(int, err);
QFETCH(bool, ipv6);
- if (ipv6 && !ipv6LookupsAvailable) {
+ if (ipv6 && !ipv6LookupsAvailable)
QSKIP("IPv6 reverse lookups are not supported on this platform");
- }
QHostInfo info = QHostInfo::fromName(address);
@@ -450,7 +449,7 @@ void tst_QHostInfo::reverseLookup()
if (!hostNames.contains(info.hostName()))
qDebug() << "Failure: expecting" << hostNames << ",got " << info.hostName();
QVERIFY(hostNames.contains(info.hostName()));
- QCOMPARE(info.addresses().first(), QHostAddress(address));
+ QCOMPARE(info.addresses().constFirst(), QHostAddress(address));
} else {
QCOMPARE(info.hostName(), address);
QCOMPARE(info.error(), QHostInfo::HostNotFound);