diff options
Diffstat (limited to 'tests/benchmarks/network/kernel/qhostinfo/main.cpp')
-rw-r--r-- | tests/benchmarks/network/kernel/qhostinfo/main.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
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); |