diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-08-15 13:09:55 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-08-15 16:53:19 +0200 |
commit | c7ec7cd2a1ae9bec31113fae1f1e549b2bf98e0b (patch) | |
tree | fc81fba4e7815ea061da277cf3bcf3102866932f /src/testlib/qbenchmark_p.h | |
parent | 7947032e2d1d68b2c0f79874db7adcf560851f29 (diff) | |
parent | 6132260da394a9627947f0fe6a279c20863b6ad2 (diff) |
Merge branch 'wip/qt6' into wip/cmake
Change-Id: I50ac36b8803c296998149e98cc61e38687cdd14b
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: |