summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorten Sorvig <msorvig@trolltech.com>2009-08-11 11:13:11 (GMT)
committerMorten Sorvig <msorvig@trolltech.com>2009-08-11 11:13:11 (GMT)
commit73b61029b00e12f313f9097d665539792d53e885 (patch)
treed2c51b3a51e0da4e160d174df70f09accae0cc41
parent68cf12a907c4fbc918019dad2c2a845466d15a30 (diff)
downloadQt-73b61029b00e12f313f9097d665539792d53e885.zip
Qt-73b61029b00e12f313f9097d665539792d53e885.tar.gz
Qt-73b61029b00e12f313f9097d665539792d53e885.tar.bz2
Fix BC breakage caused by commit 7aa2d76d.
Code compiled with 4.5 expects to find the QBenchmarkIterationController() constructor, so ad an overload instead of replacing it.
-rw-r--r--src/testlib/qbenchmark.cpp7
-rw-r--r--src/testlib/qbenchmark.h3
2 files changed, 9 insertions, 1 deletions
diff --git a/src/testlib/qbenchmark.cpp b/src/testlib/qbenchmark.cpp
index eaec02f..42ce662 100644
--- a/src/testlib/qbenchmark.cpp
+++ b/src/testlib/qbenchmark.cpp
@@ -197,6 +197,13 @@ QTest::QBenchmarkIterationController::QBenchmarkIterationController(RunMode runM
if (runMode == RunOnce)
QBenchmarkTestMethodData::current->runOnce = true;
}
+
+QTest::QBenchmarkIterationController::QBenchmarkIterationController()
+{
+ QTest::beginBenchmarkMeasurement();
+ i = 0;
+}
+
/*! \internal
*/
QTest::QBenchmarkIterationController::~QBenchmarkIterationController()
diff --git a/src/testlib/qbenchmark.h b/src/testlib/qbenchmark.h
index 87d34e7..7b1792d 100644
--- a/src/testlib/qbenchmark.h
+++ b/src/testlib/qbenchmark.h
@@ -65,6 +65,7 @@ class Q_TESTLIB_EXPORT QBenchmarkIterationController
{
public:
enum RunMode { RepeatUntilValidMeasurement, RunOnce };
+ QBenchmarkIterationController();
QBenchmarkIterationController(RunMode runMode);
~QBenchmarkIterationController();
bool isDone();
@@ -75,7 +76,7 @@ public:
}
#define QBENCHMARK \
- for (QTest::QBenchmarkIterationController __iteration_controller(QTest::QBenchmarkIterationController::RepeatUntilValidMeasurement); \
+ for (QTest::QBenchmarkIterationController __iteration_controller(); \
__iteration_controller.isDone() == false; __iteration_controller.next())
#define QBENCHMARK_ONCE \