diff options
author | Lars Knoll <lars.knoll@qt.io> | 2020-09-10 20:39:49 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2020-09-11 00:20:47 +0200 |
commit | 6ae7a02104631a2234c475575ae15ca79bef14f9 (patch) | |
tree | 5ca2db0e3aa3c7851c6d19117147c581bebeeee3 /tests/auto/concurrent/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp | |
parent | 459e8dfdfb8ac164383c14332b2b0919f59f8b3c (diff) |
Remove most compiler warnings about missing overrides
Remove around 1000 compiler warnings about missing overrides
in our auto tests.
This significantly reduce the compiler warning noise in our auto
tests, so that one can actually better see the real problems
inbetween.
Change-Id: Id0c04dba43fcaf55d8cd2b5c6697358857c31bf9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'tests/auto/concurrent/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp')
-rw-r--r-- | tests/auto/concurrent/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/tests/auto/concurrent/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp b/tests/auto/concurrent/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp index e192dad3bd..a39488fd62 100644 --- a/tests/auto/concurrent/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp +++ b/tests/auto/concurrent/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp @@ -56,7 +56,7 @@ class PrintUser : public ThreadEngine<void> { public: PrintUser() : ThreadEngine(QThreadPool::globalInstance()) {} - ThreadFunctionResult threadFunction() + ThreadFunctionResult threadFunction() override { QTest::qSleep(50); QTest::qSleep(100); @@ -86,18 +86,18 @@ public: : ThreadEngine(QThreadPool::globalInstance()) , done(false) { } - bool shouldStartThread() + bool shouldStartThread() override { return !done; } - ThreadFunctionResult threadFunction() + ThreadFunctionResult threadFunction() override { done = true; return ThreadFinished; } - QString *result() + QString *result() override { foo = "Foo"; return &foo; @@ -117,18 +117,18 @@ class VoidResultUser : public ThreadEngine<void> public: VoidResultUser() : ThreadEngine(QThreadPool::globalInstance()) {} - bool shouldStartThread() + bool shouldStartThread() override { return !done; } - ThreadFunctionResult threadFunction() + ThreadFunctionResult threadFunction() override { done = true; return ThreadFinished; } - void *result() + void *result() override { return 0; } @@ -155,12 +155,12 @@ class CancelUser : public ThreadEngine<void> public: CancelUser() : ThreadEngine(QThreadPool::globalInstance()) {} - void *result() + void *result() override { return 0; } - ThreadFunctionResult threadFunction() + ThreadFunctionResult threadFunction() override { while (this->isCanceled() == false) { @@ -198,12 +198,12 @@ public: finishing = false; } - bool shouldStartThread() + bool shouldStartThread() override { return !finishing; } - ThreadFunctionResult threadFunction() + ThreadFunctionResult threadFunction() override { forever { const int local = count.loadRelaxed(); @@ -253,12 +253,12 @@ public: finishing = finishImmediately; } - bool shouldStartThread() + bool shouldStartThread() override { return !finishing; } - ThreadFunctionResult threadFunction() + ThreadFunctionResult threadFunction() override { { QMutexLocker lock(&mutex); @@ -315,12 +315,12 @@ class MultipleResultsUser : public ThreadEngine<int> { public: MultipleResultsUser() : ThreadEngine(QThreadPool::globalInstance()) {} - bool shouldStartThread() + bool shouldStartThread() override { return false; } - ThreadFunctionResult threadFunction() + ThreadFunctionResult threadFunction() override { for (int i = 0; i < 10; ++i) this->reportResult(&i); @@ -344,17 +344,17 @@ void tst_QtConcurrentThreadEngine::multipleResults() class NoThreadsUser : public ThreadEngine<void> { public: - bool shouldStartThread() + bool shouldStartThread() override { return false; } - ThreadFunctionResult threadFunction() + ThreadFunctionResult threadFunction() override { return ThreadFinished; } - void *result() + void *result() override { return 0; } @@ -385,8 +385,8 @@ class SlowUser : public ThreadEngine<void> { public: SlowUser() : ThreadEngine(QThreadPool::globalInstance()) {} - bool shouldStartThread() { return false; } - ThreadFunctionResult threadFunction() { QTest::qSleep(sleepTime); return ThreadFinished; } + bool shouldStartThread() override { return false; } + ThreadFunctionResult threadFunction() override { QTest::qSleep(sleepTime); return ThreadFinished; } }; void tst_QtConcurrentThreadEngine::cancelQueuedSlowUser() |