diff options
author | Markus Goetz <Markus.Goetz@nokia.com> | 2010-03-04 14:03:10 (GMT) |
---|---|---|
committer | Markus Goetz <Markus.Goetz@nokia.com> | 2010-03-04 14:03:10 (GMT) |
commit | f68597ee9f63d3a7c5254062b752e8a91b816919 (patch) | |
tree | 4695072f0a95392e227956e1500bcbf9ddb5921e /tests/benchmarks | |
parent | d38158bbba32ce6a80b4443ca92f37f485ebfa93 (diff) | |
download | Qt-f68597ee9f63d3a7c5254062b752e8a91b816919.zip Qt-f68597ee9f63d3a7c5254062b752e8a91b816919.tar.gz Qt-f68597ee9f63d3a7c5254062b752e8a91b816919.tar.bz2 |
qhostinfo benchmark: Use local _data instead of _global
Qt's benchmark lib does not support global data tags yet.
Diffstat (limited to 'tests/benchmarks')
-rw-r--r-- | tests/benchmarks/network/kernel/qhostinfo/main.cpp | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/tests/benchmarks/network/kernel/qhostinfo/main.cpp b/tests/benchmarks/network/kernel/qhostinfo/main.cpp index ebdea5e..f4648d6 100644 --- a/tests/benchmarks/network/kernel/qhostinfo/main.cpp +++ b/tests/benchmarks/network/kernel/qhostinfo/main.cpp @@ -54,9 +54,9 @@ class tst_qhostinfo : public QObject { Q_OBJECT public slots: - void initTestCase(); void init(); private slots: + void lookupSpeed_data(); void lookupSpeed(); }; @@ -75,28 +75,23 @@ public slots: } }; -void tst_qhostinfo::initTestCase() -{ - // run each testcase with and without cache enabled - QTest::addColumn<bool>("cache"); - QTest::newRow("WithCache") << true; - QTest::newRow("WithoutCache") << false; -} - void tst_qhostinfo::init() { // delete the cache so inidividual testcase results are independant from each other qt_qhostinfo_clear_cache(); - - QFETCH_GLOBAL(bool, cache); - qt_qhostinfo_enable_cache(cache); } +void tst_qhostinfo::lookupSpeed_data() +{ + QTest::addColumn<bool>("cache"); + QTest::newRow("WithCache") << true; + QTest::newRow("WithoutCache") << false; +} void tst_qhostinfo::lookupSpeed() { - QFETCH_GLOBAL(bool, cache); - qDebug() << "Cache enabled:" << cache; + 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" |