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.6 6.5 Change-Id: Id643b20dfa5a541fea56abfdbcf933245a8a3c9d Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 3c5e37fe0ff761bd4ee4eeea67881ec7b8eadad5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
7c06008369
commit
744313ae79
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user