diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2022-10-21 11:56:37 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2022-11-09 02:18:44 -0700 |
commit | b5b00e77906af0ebc848d9244fab816bd1c9afcc (patch) | |
tree | 4bf3a3e48fb832010c1a8c66210ad96d79722273 /src/testlib/qtestcase.cpp | |
parent | 985b94215276eebf4acdd2625829d90a27213d64 (diff) |
QBenchlib: use QBenchmarkMeasurerBase::Measurement in QBenchmarkResult
Change-Id: I3c79b7e08fa346988dfefffd17202a818cde1d84
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/testlib/qtestcase.cpp')
-rw-r--r-- | src/testlib/qtestcase.cpp | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index 335b72f1fb..24581011c2 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -1097,15 +1097,6 @@ struct QTestDataSetter } }; -namespace { - -qreal addResult(qreal current, const QBenchmarkResult& r) -{ - return current + r.value; -} - -} - void TestMethods::invokeTestOnData(int index) const { /* Benchmarking: for each median iteration*/ @@ -1179,11 +1170,11 @@ void TestMethods::invokeTestOnData(int index) const if (i == -1) { QTestLog::info(qPrintable( QString::fromLatin1("warmup stage result : %1") - .arg(QBenchmarkTestMethodData::current->result.value)), nullptr, 0); + .arg(QBenchmarkTestMethodData::current->result.measurement.value)), nullptr, 0); } else { QTestLog::info(qPrintable( QString::fromLatin1("accumulation stage result: %1") - .arg(QBenchmarkTestMethodData::current->result.value)), nullptr, 0); + .arg(QBenchmarkTestMethodData::current->result.measurement.value)), nullptr, 0); } } } @@ -1192,6 +1183,9 @@ void TestMethods::invokeTestOnData(int index) const if (QBenchmarkGlobalData::current->minimumTotal == -1) { minimumTotalReached = true; } else { + auto addResult = [](qreal current, const QBenchmarkResult& r) { + return current + r.measurement.value; + }; const qreal total = std::accumulate(results.begin(), results.end(), 0.0, addResult); minimumTotalReached = (total >= QBenchmarkGlobalData::current->minimumTotal); } |