summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-03-04 20:50:46 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-03-04 20:50:46 (GMT)
commitac192ca74b90e059f96d6c24c4bb8295778d1eaa (patch)
tree28dbc4aca33bb6e90805e6b4e0980c3ae7002c10 /tests
parentf5b52405ea347a5cde4562f0375f1bed0f0d4b5d (diff)
parent95786655e304a22bd922b40184d314eddb72b002 (diff)
downloadQt-ac192ca74b90e059f96d6c24c4bb8295778d1eaa.zip
Qt-ac192ca74b90e059f96d6c24c4bb8295778d1eaa.tar.gz
Qt-ac192ca74b90e059f96d6c24c4bb8295778d1eaa.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1: tst_qhostinfo: Compile fix Document some stuff in QHostInfo and QAbstractSocket tst_qhostinfo: Mixed up descriptions for test case data qhostinfo benchmark: Use local _data instead of _global DNS Cache: Also check inside the DNS threads qhostinfo benchmark: Benchmark the with-cache and without-cache tst_qftp: Do not use 1.2.3.4 as IP Dont use gestures if there is no touch screen. showFullscreen() broken if UnifiedTitleAndToolBarOnMac is enabled Fix atk warning on startup in Qt apps wit QGtkStyle Do not use realpath() with uclibc
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qftp/tst_qftp.cpp2
-rw-r--r--tests/auto/qhostinfo/tst_qhostinfo.cpp11
-rw-r--r--tests/benchmarks/network/kernel/qhostinfo/main.cpp24
3 files changed, 31 insertions, 6 deletions
diff --git a/tests/auto/qftp/tst_qftp.cpp b/tests/auto/qftp/tst_qftp.cpp
index 240885d..638c810 100644
--- a/tests/auto/qftp/tst_qftp.cpp
+++ b/tests/auto/qftp/tst_qftp.cpp
@@ -308,7 +308,7 @@ void tst_QFtp::connectToUnresponsiveHost()
if (setProxy)
QSKIP( "This test takes too long if we test with proxies too", SkipSingle );
- QString host = "1.2.3.4";
+ QString host = "192.0.2.42"; // IP out of TEST-NET, should be unreachable
uint port = 21;
ftp = newFtp();
diff --git a/tests/auto/qhostinfo/tst_qhostinfo.cpp b/tests/auto/qhostinfo/tst_qhostinfo.cpp
index cbadcf5..4282062 100644
--- a/tests/auto/qhostinfo/tst_qhostinfo.cpp
+++ b/tests/auto/qhostinfo/tst_qhostinfo.cpp
@@ -213,8 +213,8 @@ void tst_QHostInfo::initTestCase()
// run each testcase with and without test enabled
QTest::addColumn<bool>("cache");
- QTest::newRow("WithCache") << false;
- QTest::newRow("WithoutCache") << true;
+ QTest::newRow("WithCache") << true;
+ QTest::newRow("WithoutCache") << false;
}
void tst_QHostInfo::init()
@@ -484,7 +484,8 @@ void tst_QHostInfo::cache()
// lookup once, wait in event loop, result should not come directly.
bool valid = true;
- QHostInfo result = qt_qhostinfo_lookup("localhost", this, SLOT(resultsReady(QHostInfo)), &valid);
+ int id = -1;
+ QHostInfo result = qt_qhostinfo_lookup("localhost", this, SLOT(resultsReady(QHostInfo)), &valid, &id);
QTestEventLoop::instance().enterLoop(5);
QVERIFY(!QTestEventLoop::instance().timeout());
QVERIFY(valid == false);
@@ -492,7 +493,7 @@ void tst_QHostInfo::cache()
// loopkup second time, result should come directly
valid = false;
- result = qt_qhostinfo_lookup("localhost", this, SLOT(resultsReady(QHostInfo)), &valid);
+ result = qt_qhostinfo_lookup("localhost", this, SLOT(resultsReady(QHostInfo)), &valid, &id);
QVERIFY(valid == true);
QVERIFY(!result.addresses().isEmpty());
@@ -501,7 +502,7 @@ void tst_QHostInfo::cache()
// lookup third time, result should not come directly.
valid = true;
- result = qt_qhostinfo_lookup("localhost", this, SLOT(resultsReady(QHostInfo)), &valid);
+ result = qt_qhostinfo_lookup("localhost", this, SLOT(resultsReady(QHostInfo)), &valid, &id);
QTestEventLoop::instance().enterLoop(5);
QVERIFY(!QTestEventLoop::instance().timeout());
QVERIFY(valid == false);
diff --git a/tests/benchmarks/network/kernel/qhostinfo/main.cpp b/tests/benchmarks/network/kernel/qhostinfo/main.cpp
index 0ae1b7f..f4648d6 100644
--- a/tests/benchmarks/network/kernel/qhostinfo/main.cpp
+++ b/tests/benchmarks/network/kernel/qhostinfo/main.cpp
@@ -48,10 +48,15 @@
#include <qtest.h>
#include <qtesteventloop.h>
+#include "private/qhostinfo_p.h"
+
class tst_qhostinfo : public QObject
{
Q_OBJECT
+public slots:
+ void init();
private slots:
+ void lookupSpeed_data();
void lookupSpeed();
};
@@ -70,14 +75,33 @@ public slots:
}
};
+void tst_qhostinfo::init()
+{
+ // delete the cache so inidividual testcase results are independant from each other
+ qt_qhostinfo_clear_cache();
+}
+
+void tst_qhostinfo::lookupSpeed_data()
+{
+ QTest::addColumn<bool>("cache");
+ QTest::newRow("WithCache") << true;
+ QTest::newRow("WithoutCache") << false;
+}
+
void tst_qhostinfo::lookupSpeed()
{
+ QFETCH(bool, cache);
+ qt_qhostinfo_enable_cache(cache);
+
QStringList hostnameList;
hostnameList << "www.ovi.com" << "www.nokia.com" << "qt.nokia.com" << "www.trolltech.com" << "troll.no"
<< "www.qtcentre.org" << "forum.nokia.com" << "www.forum.nokia.com" << "wiki.forum.nokia.com"
<< "www.nokia.no" << "nokia.de" << "127.0.0.1" << "----";
// also add some duplicates:
hostnameList << "www.nokia.com" << "127.0.0.1" << "www.trolltech.com";
+ // and some more
+ hostnameList << hostnameList;
+
const int COUNT = hostnameList.size();
SignalReceiver receiver(COUNT);