1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 01:22:10 +01:00

[PACTest] Correctly accept localhost resolved IPv4/6 addresses

This commit is contained in:
nowrep 2014-02-01 17:55:20 +01:00
parent 3635edc88f
commit d65512d9f6

View File

@ -159,7 +159,7 @@ void PacTest::dnsResolveTest_data()
QTest::addColumn<QString>("host");
QTest::addColumn<QString>("result");
QTest::newRow("localhost") << "localhost" << "127.0.0.1";
QTest::newRow("localhost") << "localhost" << "";
QTest::newRow("qz") << "qupzilla.com" << "85.118.128.38"; // This may change...
}
@ -169,7 +169,16 @@ void PacTest::dnsResolveTest()
QFETCH(QString, result);
QString source = QString("dnsResolve('%1')").arg(host);
QCOMPARE(m_runner->evaluate(source).toString(), result);
QString res = m_runner->evaluate(source).toString();
if (host == "localhost") {
if (res != "127.0.0.1" && res != "::1") {
QFAIL("localhost incorrectly resolved!");
}
return;
}
QCOMPARE(res, result);
}
void PacTest::dnsDomainLevelsTest_data()