summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/thread/qthreadpool
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-09-10 20:39:49 +0200
committerLars Knoll <lars.knoll@qt.io>2020-09-11 00:20:47 +0200
commit6ae7a02104631a2234c475575ae15ca79bef14f9 (patch)
tree5ca2db0e3aa3c7851c6d19117147c581bebeeee3 /tests/auto/corelib/thread/qthreadpool
parent459e8dfdfb8ac164383c14332b2b0919f59f8b3c (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/corelib/thread/qthreadpool')
-rw-r--r--tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp40
1 files changed, 21 insertions, 19 deletions
diff --git a/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp b/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp
index 1d3d75d930..9b536aec00 100644
--- a/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp
+++ b/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp
@@ -43,7 +43,7 @@ class FunctionPointerTask : public QRunnable
public:
FunctionPointerTask(FunctionPointer function)
:function(function) {}
- void run() { function(); }
+ void run() override { function(); }
private:
FunctionPointer function;
};
@@ -228,7 +228,7 @@ QAtomicInt ran; // bool
class TestTask : public QRunnable
{
public:
- void run()
+ void run() override
{
ran.storeRelaxed(true);
}
@@ -256,7 +256,7 @@ QAtomicInt *value = 0;
class IntAccessor : public QRunnable
{
public:
- void run()
+ void run() override
{
for (int i = 0; i < 100; ++i) {
value->ref();
@@ -286,7 +286,7 @@ QThread *recycledThread = 0;
class ThreadRecorderTask : public QRunnable
{
public:
- void run()
+ void run() override
{
recycledThread = QThread::currentThread();
threadRecyclingSemaphore.release();
@@ -332,7 +332,7 @@ public:
setAutoDelete(false);
}
- void run()
+ void run() override
{
thread = QThread::currentThread();
runCount.ref();
@@ -474,7 +474,7 @@ void tst_QThreadPool::setMaxThreadCountStartsAndStopsThreads()
WaitingTask() { setAutoDelete(false); }
- void run()
+ void run() override
{
waitForStarted.release();
waitToFinish.acquire();
@@ -671,7 +671,7 @@ void tst_QThreadPool::reserveAndStart() // QTBUG-21051
WaitingTask() { setAutoDelete(false); }
- void run()
+ void run() override
{
count.ref();
waitForStarted.release();
@@ -722,7 +722,8 @@ void tst_QThreadPool::reserveAndStart() // QTBUG-21051
QAtomicInt count;
class CountingRunnable : public QRunnable
{
- public: void run()
+public:
+ void run() override
{
count.ref();
}
@@ -750,7 +751,7 @@ void tst_QThreadPool::tryStart()
WaitingTask() { setAutoDelete(false); }
- void run()
+ void run() override
{
semaphore.acquire();
count.ref();
@@ -780,7 +781,7 @@ void tst_QThreadPool::tryStartPeakThreadCount()
public:
CounterTask() { setAutoDelete(false); }
- void run()
+ void run() override
{
{
QMutexLocker lock(&mutex);
@@ -819,7 +820,7 @@ void tst_QThreadPool::tryStartCount()
public:
SleeperTask() { setAutoDelete(false); }
- void run()
+ void run() override
{
QTest::qWait(50);
}
@@ -854,7 +855,7 @@ void tst_QThreadPool::priorityStart()
public:
QSemaphore &sem;
Holder(QSemaphore &sem) : sem(sem) {}
- void run()
+ void run() override
{
sem.acquire();
}
@@ -864,7 +865,7 @@ void tst_QThreadPool::priorityStart()
public:
QAtomicPointer<QRunnable> &ptr;
Runner(QAtomicPointer<QRunnable> &ptr) : ptr(ptr) {}
- void run()
+ void run() override
{
ptr.testAndSetRelaxed(0, this);
}
@@ -928,7 +929,7 @@ void tst_QThreadPool::waitForDoneTimeout()
QMutex &mutex;
explicit BlockedTask(QMutex &m) : mutex(m) {}
- void run()
+ void run() override
{
mutex.lock();
mutex.unlock();
@@ -953,7 +954,7 @@ void tst_QThreadPool::clear()
public:
QSemaphore & sem;
BlockingRunnable(QSemaphore & sem) : sem(sem){}
- void run()
+ void run() override
{
sem.acquire();
count.ref();
@@ -1105,7 +1106,7 @@ void tst_QThreadPool::stackSize()
}
- void run()
+ void run() override
{
*stackSize = QThread::currentThread()->stackSize();
}
@@ -1136,7 +1137,7 @@ void tst_QThreadPool::stressTest()
semaphore.acquire();
}
- void run()
+ void run() override
{
semaphore.release();
}
@@ -1162,7 +1163,8 @@ void tst_QThreadPool::takeAllAndIncreaseMaxThreadCount() {
setAutoDelete(false);
}
- void run() {
+ void run() override
+ {
m_mainBarrier->release();
m_threadBarrier->acquire();
}
@@ -1224,7 +1226,7 @@ void tst_QThreadPool::waitForDoneAfterTake()
, m_threadBarrier(threadBarrier)
{}
- void run()
+ void run() override
{
m_mainBarrier->release();
m_threadBarrier->acquire();