From f68597ee9f63d3a7c5254062b752e8a91b816919 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Thu, 4 Mar 2010 15:03:10 +0100 Subject: qhostinfo benchmark: Use local _data instead of _global Qt's benchmark lib does not support global data tags yet. --- tests/benchmarks/network/kernel/qhostinfo/main.cpp | 23 +++++++++------------- 1 file 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("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("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" -- cgit v0.12