From c7dd882b7a9b1f78e2aa8b482a54d33dce9497fe Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Mon, 24 Oct 2011 16:26:50 +1000 Subject: Improve qhostinfo autotest on HPUX 11i Several test functions use IPv6 reverse lookups, which evidently don't work on HPUX 11i, but only one of these tests was skipped on that platform and the others presumably fail. This commit also removes the commented-out test data and makes it easier to put some useful test data back. QTBUG-22287 records the fact that no real IPv6 hostnames are currently used in the reverseLookup test. Change-Id: Iff1ed1b725492bcc28ca4cb5f8e2dc106887c0b4 Reviewed-by: Rohan McGovern --- .../network/kernel/qhostinfo/tst_qhostinfo.cpp | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp b/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp index e9acf686f0..fbf414483b 100644 --- a/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp +++ b/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp @@ -214,7 +214,8 @@ void tst_QHostInfo::initTestCase() ipv6Available = true; } -#if !defined(QT_NO_GETADDRINFO) +// HP-UX 11i does not support IPv6 reverse lookups. +#if !defined(QT_NO_GETADDRINFO) || !(defined(Q_OS_HPUX) && defined(__ia64)) // check if the system getaddrinfo can do IPv6 lookups struct addrinfo hint, *result = 0; memset(&hint, 0, sizeof hint); @@ -355,13 +356,11 @@ void tst_QHostInfo::reverseLookup_data() QTest::addColumn("address"); QTest::addColumn("hostNames"); QTest::addColumn("err"); + QTest::addColumn("ipv6"); - QTest::newRow("trolltech.com") << QString("62.70.27.69") << QStringList(QString("diverse.troll.no")) << 0; - - // ### Use internal DNS instead. Discussed with Andreas. - //QTest::newRow("classical.hexago.com") << QString("2001:5c0:0:2::24") << QStringList(QString("classical.hexago.com")) << 0; - QTest::newRow("gitorious.org") << QString("87.238.52.168") << QStringList(QString("gitorious.org")) << 0; - QTest::newRow("bogus-name") << QString("1::2::3::4") << QStringList() << 1; + QTest::newRow("trolltech.com") << QString("62.70.27.69") << QStringList(QString("diverse.troll.no")) << 0 << false; + QTest::newRow("gitorious.org") << QString("87.238.52.168") << QStringList(QString("gitorious.org")) << 0 << false; + QTest::newRow("bogus-name") << QString("1::2::3::4") << QStringList() << 1 << true; } void tst_QHostInfo::reverseLookup() @@ -369,14 +368,11 @@ void tst_QHostInfo::reverseLookup() QFETCH(QString, address); QFETCH(QStringList, hostNames); QFETCH(int, err); + QFETCH(bool, ipv6); - if (!ipv6LookupsAvailable && hostNames.contains("classical.hexago.com")) { - QSKIP("IPv6 lookups are not supported on this platform"); + if (ipv6 && !ipv6LookupsAvailable) { + QSKIP("IPv6 reverse lookups are not supported on this platform"); } -#if defined(Q_OS_HPUX) && defined(__ia64) - if (hostNames.contains("classical.hexago.com")) - QSKIP("HP-UX 11i does not support IPv6 reverse lookups."); -#endif QHostInfo info = QHostInfo::fromName(address); -- cgit v1.2.3