diff --git a/src/testlib/qbenchmark.cpp b/src/testlib/qbenchmark.cpp index 4a8bd72ee9..af6ee5f7c6 100644 --- a/src/testlib/qbenchmark.cpp +++ b/src/testlib/qbenchmark.cpp @@ -167,7 +167,7 @@ QTest::QBenchmarkIterationController::~QBenchmarkIterationController() /*! \internal */ -bool QTest::QBenchmarkIterationController::isDone() +bool QTest::QBenchmarkIterationController::isDone() const noexcept { if (QBenchmarkTestMethodData::current->runOnce) return i > 0; @@ -176,14 +176,14 @@ bool QTest::QBenchmarkIterationController::isDone() /*! \internal */ -void QTest::QBenchmarkIterationController::next() +void QTest::QBenchmarkIterationController::next() noexcept { ++i; } /*! \internal */ -int QTest::iterationCount() +int QTest::iterationCount() noexcept { return QBenchmarkTestMethodData::current->iterationCount; } diff --git a/src/testlib/qbenchmark.h b/src/testlib/qbenchmark.h index 20c643b2c6..d0e8c78567 100644 --- a/src/testlib/qbenchmark.h +++ b/src/testlib/qbenchmark.h @@ -28,8 +28,8 @@ public: QBenchmarkIterationController(); QBenchmarkIterationController(RunMode runMode); ~QBenchmarkIterationController(); - bool isDone(); - void next(); + bool isDone() const noexcept; + void next() noexcept; int i; }; diff --git a/src/testlib/qbenchmark_p.h b/src/testlib/qbenchmark_p.h index 09379aac0f..902b092b16 100644 --- a/src/testlib/qbenchmark_p.h +++ b/src/testlib/qbenchmark_p.h @@ -149,7 +149,7 @@ public: // low-level API: namespace QTest { - int iterationCount(); + int iterationCount() noexcept; void setIterationCountHint(int count); void setIterationCount(int count);