summaryrefslogtreecommitdiffstats
path: root/tests/auto/network/kernel/qhostinfo
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2019-07-30 13:47:36 +0200
committerLiang Qi <liang.qi@qt.io>2019-07-30 13:47:36 +0200
commit71ec1d6d79c16c46837dbd10f1cd2a53027a6682 (patch)
tree5008d058a0ea3ef379c36ad2364d9b2bc78f3aaf /tests/auto/network/kernel/qhostinfo
parent31753adebe0f19b90f332e81e1a9b063b40f982d (diff)
parent75f51d2f40746205484b969a72a56d75d5d8ff39 (diff)
Merge remote-tracking branch 'origin/5.13' into dev
Conflicts: qmake/generators/win32/mingw_make.cpp Change-Id: I2f790bc8572bd22fea01edf7ca74595b29f063eb
Diffstat (limited to 'tests/auto/network/kernel/qhostinfo')
-rw-r--r--tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp b/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp
index da6e02210b..a603b2d879 100644
--- a/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp
+++ b/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp
@@ -92,6 +92,7 @@ private slots:
void lookupIPv6();
void lookupConnectToFunctionPointer_data();
void lookupConnectToFunctionPointer();
+ void lookupConnectToFunctionPointerDeleted();
void lookupConnectToLambda_data();
void lookupConnectToLambda();
void reverseLookup_data();
@@ -358,6 +359,17 @@ void tst_QHostInfo::lookupConnectToFunctionPointer()
QCOMPARE(tmp.join(' '), expected.join(' '));
}
+void tst_QHostInfo::lookupConnectToFunctionPointerDeleted()
+{
+ {
+ QObject contextObject;
+ QHostInfo::lookupHost("localhost", &contextObject, [](const QHostInfo){
+ QFAIL("This should never be called!");
+ });
+ }
+ QTestEventLoop::instance().enterLoop(3);
+}
+
void tst_QHostInfo::lookupConnectToLambda_data()
{
lookupIPv4_data();
@@ -464,7 +476,9 @@ void tst_QHostInfo::reverseLookup_data()
QTest::newRow("dns.google") << QString("8.8.8.8") << reverseLookupHelper("8.8.8.8") << 0 << false;
QTest::newRow("one.one.one.one") << QString("1.1.1.1") << reverseLookupHelper("1.1.1.1") << 0 << false;
- QTest::newRow("bogus-name") << QString("1::2::3::4") << QStringList() << 1 << true;
+ QTest::newRow("dns.google IPv6") << QString("2001:4860:4860::8888") << reverseLookupHelper("2001:4860:4860::8888") << 0 << true;
+ QTest::newRow("cloudflare IPv6") << QString("2606:4700:4700::1111") << reverseLookupHelper("2606:4700:4700::1111") << 0 << true;
+ QTest::newRow("bogus-name IPv6") << QString("1::2::3::4") << QStringList() << 1 << true;
}
void tst_QHostInfo::reverseLookup()
@@ -705,6 +719,7 @@ void tst_QHostInfo::cache()
void tst_QHostInfo::resultsReady(const QHostInfo &hi)
{
+ QVERIFY(QThread::currentThread() == thread());
lookupDone = true;
lookupResults = hi;
lookupsDoneCounter++;