diff options
Diffstat (limited to 'src/testlib/qbenchmark_p.h')
-rw-r--r-- | src/testlib/qbenchmark_p.h | 46 |
1 files changed, 20 insertions, 26 deletions
diff --git a/src/testlib/qbenchmark_p.h b/src/testlib/qbenchmark_p.h index 49868ac23a..93b5becb2b 100644 --- a/src/testlib/qbenchmark_p.h +++ b/src/testlib/qbenchmark_p.h @@ -81,7 +81,7 @@ struct QBenchmarkContext QString slotName; QString tag; // from _data() function - int checkpointIndex; + int checkpointIndex = -1; QString toString() const { @@ -89,7 +89,7 @@ struct QBenchmarkContext .arg(slotName, tag, QString::number(checkpointIndex)); } - QBenchmarkContext() : checkpointIndex(-1) {} + QBenchmarkContext() = default; }; Q_DECLARE_TYPEINFO(QBenchmarkContext, Q_MOVABLE_TYPE); @@ -97,19 +97,13 @@ class QBenchmarkResult { public: QBenchmarkContext context; - qreal value; - int iterations; - QTest::QBenchmarkMetric metric; - bool setByMacro; - bool valid; - - QBenchmarkResult() - : value(-1) - , iterations(-1) - , metric(QTest::FramesPerSecond) - , setByMacro(true) - , valid(false) - { } + qreal value = -1; + int iterations = -1; + QTest::QBenchmarkMetric metric = QTest::FramesPerSecond; + bool setByMacro = true; + bool valid = false; + + QBenchmarkResult() = default; QBenchmarkResult( const QBenchmarkContext &context, const qreal value, const int iterations, @@ -147,17 +141,17 @@ public: QBenchmarkMeasurerBase *createMeasurer(); int adjustMedianIterationCount(); - QBenchmarkMeasurerBase *measurer; + QBenchmarkMeasurerBase *measurer = nullptr; QBenchmarkContext context; - int walltimeMinimum; - int iterationCount; - int medianIterationCount; - bool createChart; - bool verboseOutput; + int walltimeMinimum = -1; + int iterationCount = -1; + int medianIterationCount = -1; + bool createChart = false; + bool verboseOutput = false; QString callgrindOutFileBase; - int minimumTotal; + int minimumTotal = -1; private: - Mode mode_; + Mode mode_ = WallTime; }; /* @@ -184,9 +178,9 @@ public: void setResult(qreal value, QTest::QBenchmarkMetric metric, bool setByMacro = true); QBenchmarkResult result; - bool resultAccepted; - bool runOnce; - int iterationCount; + bool resultAccepted = false; + bool runOnce = false; + int iterationCount = -1; }; // low-level API: |