diff options
Diffstat (limited to 'tests/auto/qhostinfo/tst_qhostinfo.cpp')
-rw-r--r-- | tests/auto/qhostinfo/tst_qhostinfo.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/tests/auto/qhostinfo/tst_qhostinfo.cpp b/tests/auto/qhostinfo/tst_qhostinfo.cpp index 4b60aca..7d43f5a 100644 --- a/tests/auto/qhostinfo/tst_qhostinfo.cpp +++ b/tests/auto/qhostinfo/tst_qhostinfo.cpp @@ -14,7 +14,7 @@ ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software +** General Public License version 2.1 as published by Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements @@ -87,11 +87,14 @@ # endif #endif +#include "../network-settings.h" + //TESTED_CLASS= //TESTED_FILES= const char * const lupinellaIp = "10.3.4.6"; + class tst_QHostInfo : public QObject { Q_OBJECT @@ -160,6 +163,7 @@ void tst_QHostInfo::staticInformation() tst_QHostInfo::tst_QHostInfo() { + Q_SET_DEFAULT_IAP } tst_QHostInfo::~tst_QHostInfo() @@ -212,11 +216,18 @@ void tst_QHostInfo::lookupIPv4_data() QTest::addColumn<QString>("addresses"); QTest::addColumn<int>("err"); +#ifdef Q_OS_SYMBIAN + // Test server lookup + QTest::newRow("lookup_01") << QtNetworkSettings::serverName() << QtNetworkSettings::serverIP().toString() << int(QHostInfo::NoError); + QTest::newRow("literal_ip4") << QtNetworkSettings::serverIP().toString() << QtNetworkSettings::serverIP().toString() << int(QHostInfo::NoError); + QTest::newRow("multiple_ip4") << "multi.dev.troll.no" << "1.2.3.4 1.2.3.5 10.3.3.31" << int(QHostInfo::NoError); +#else QTest::newRow("empty") << "" << "" << int(QHostInfo::HostNotFound); QTest::newRow("single_ip4") << "lupinella.troll.no" << lupinellaIp << int(QHostInfo::NoError); QTest::newRow("multiple_ip4") << "multi.dev.troll.no" << "1.2.3.4 1.2.3.5 10.3.3.31" << int(QHostInfo::NoError); QTest::newRow("literal_ip4") << lupinellaIp << lupinellaIp << int(QHostInfo::NoError); +#endif QTest::newRow("notfound") << "this-name-does-not-exist-hopefully." << "" << int(QHostInfo::HostNotFound); QTest::newRow("idn-ace") << "xn--alqualond-34a.troll.no" << "10.3.3.55" << int(QHostInfo::NoError); @@ -380,10 +391,10 @@ protected: void tst_QHostInfo::threadSafety() { const int nattempts = 5; -#if !defined(Q_OS_WINCE) - const int runs = 100; -#else +#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN) const int runs = 10; +#else + const int runs = 100; #endif LookupThread thr[nattempts]; for (int j = 0; j < runs; ++j) { |