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/corelib/thread | |
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/corelib/thread')
13 files changed, 108 insertions, 99 deletions
diff --git a/tests/auto/corelib/thread/qatomicint/tst_qatomicint.cpp b/tests/auto/corelib/thread/qatomicint/tst_qatomicint.cpp index 58275e0372..e447f27653 100644 --- a/tests/auto/corelib/thread/qatomicint/tst_qatomicint.cpp +++ b/tests/auto/corelib/thread/qatomicint/tst_qatomicint.cpp @@ -887,7 +887,7 @@ void tst_QAtomicInt::fetchAndAdd_loop() class FetchAndAddThread : public QThread { public: - void run() + void run() override { for (int i = 0; i < iterations; ++i) diff --git a/tests/auto/corelib/thread/qfuturewatcher/tst_qfuturewatcher.cpp b/tests/auto/corelib/thread/qfuturewatcher/tst_qfuturewatcher.cpp index 0f14336a24..027bd1313e 100644 --- a/tests/auto/corelib/thread/qfuturewatcher/tst_qfuturewatcher.cpp +++ b/tests/auto/corelib/thread/qfuturewatcher/tst_qfuturewatcher.cpp @@ -232,7 +232,7 @@ void tst_QFutureWatcher::canceled() class IntTask : public RunFunctionTask<int> { public: - void runFunctor() + void runFunctor() override { result = 10; } @@ -466,7 +466,7 @@ const int maxProgress = 100000; class ProgressEmitterTask : public RunFunctionTask<void> { public: - void runFunctor() + void runFunctor() override { promise.setProgressRange(0, maxProgress); for (int p = 0; p <= maxProgress; ++p) @@ -496,7 +496,7 @@ template <typename T> class ProgressTextTask : public RunFunctionTask<T> { public: - void runFunctor() + void runFunctor() override { this->promise.setProgressValueAndText(1, QLatin1String("Foo 1")); diff --git a/tests/auto/corelib/thread/qmutex/tst_qmutex.cpp b/tests/auto/corelib/thread/qmutex/tst_qmutex.cpp index b07f8196c5..51e46f87ea 100644 --- a/tests/auto/corelib/thread/qmutex/tst_qmutex.cpp +++ b/tests/auto/corelib/thread/qmutex/tst_qmutex.cpp @@ -204,7 +204,7 @@ void tst_QMutex::tryLock_non_recursive() class Thread : public QThread { public: - void run() + void run() override { testsTurn.release(); @@ -331,7 +331,7 @@ void tst_QMutex::try_lock_for_non_recursive() { class Thread : public QThread { public: - void run() + void run() override { testsTurn.release(); @@ -460,7 +460,7 @@ void tst_QMutex::try_lock_until_non_recursive() class Thread : public QThread { public: - void run() + void run() override { const std::chrono::milliseconds systemTimersResolutionAsDuration(systemTimersResolution); testsTurn.release(); @@ -586,7 +586,7 @@ void tst_QMutex::tryLock_recursive() class Thread : public QThread { public: - void run() + void run() override { testsTurn.release(); @@ -713,7 +713,7 @@ void tst_QMutex::try_lock_for_recursive() class Thread : public QThread { public: - void run() + void run() override { testsTurn.release(); @@ -841,7 +841,7 @@ void tst_QMutex::try_lock_until_recursive() class Thread : public QThread { public: - void run() + void run() override { const std::chrono::milliseconds systemTimersResolutionAsDuration(systemTimersResolution); testsTurn.release(); @@ -972,7 +972,7 @@ public: inline mutex_Thread(QMutex &m) : test_mutex(m) { } - void run() + void run() override { test_mutex.lock(); @@ -997,7 +997,7 @@ public: inline rmutex_Thread(QRecursiveMutex &m) : test_mutex(m) { } - void run() + void run() override { test_mutex.lock(); test_mutex.lock(); @@ -1101,7 +1101,7 @@ public: t.start(); QThread::start(); } - void run() + void run() override { while (t.elapsed() < one_minute) { mutex.lock(); @@ -1140,7 +1140,7 @@ class TryLockRaceThread : public QThread public: static QMutex mutex; - void run() + void run() override { QElapsedTimer t; t.start(); @@ -1186,7 +1186,8 @@ void tst_QMutex::tryLockDeadlock() struct TrylockThread : QThread { TrylockThread(QMutex &mut) : mut(mut) {} QMutex &mut; - void run() { + void run() override + { for (int i = 0; i < 100000; ++i) { if (mut.tryLock(0)) { if ((++tryLockDeadlockCounter) != 1) @@ -1239,7 +1240,8 @@ void tst_QMutex::tryLockNegative() QMutex &mut; int timeout; int tryLockResult; - void run() { + void run() override + { tryLockResult = mut.tryLock(timeout); mut.unlock(); } @@ -1281,7 +1283,7 @@ public: t.start(); QThread::start(); } - void run() + void run() override { quint64 i = 0; while (t.elapsed() < one_minute) { diff --git a/tests/auto/corelib/thread/qmutexlocker/tst_qmutexlocker.cpp b/tests/auto/corelib/thread/qmutexlocker/tst_qmutexlocker.cpp index c83e186ca7..46cdd8073e 100644 --- a/tests/auto/corelib/thread/qmutexlocker/tst_qmutexlocker.cpp +++ b/tests/auto/corelib/thread/qmutexlocker/tst_qmutexlocker.cpp @@ -74,7 +74,7 @@ void tst_QMutexLocker::scopeTest() class ScopeTestThread : public tst_QMutexLockerThread { public: - void run() + void run() override { waitForTest(); @@ -119,7 +119,7 @@ void tst_QMutexLocker::unlockAndRelockTest() class UnlockAndRelockThread : public tst_QMutexLockerThread { public: - void run() + void run() override { QMutexLocker locker(&mutex); @@ -165,7 +165,7 @@ void tst_QMutexLocker::lockerStateTest() class LockerStateThread : public tst_QMutexLockerThread { public: - void run() + void run() override { { QMutexLocker locker(&mutex); diff --git a/tests/auto/corelib/thread/qreadlocker/tst_qreadlocker.cpp b/tests/auto/corelib/thread/qreadlocker/tst_qreadlocker.cpp index 7d1b3709c2..241f064a21 100644 --- a/tests/auto/corelib/thread/qreadlocker/tst_qreadlocker.cpp +++ b/tests/auto/corelib/thread/qreadlocker/tst_qreadlocker.cpp @@ -73,7 +73,7 @@ void tst_QReadLocker::scopeTest() class ScopeTestThread : public tst_QReadLockerThread { public: - void run() + void run() override { waitForTest(); @@ -118,7 +118,7 @@ void tst_QReadLocker::unlockAndRelockTest() class UnlockAndRelockThread : public tst_QReadLockerThread { public: - void run() + void run() override { QReadLocker locker(&lock); @@ -164,7 +164,7 @@ void tst_QReadLocker::lockerStateTest() class LockerStateThread : public tst_QReadLockerThread { public: - void run() + void run() override { { QReadLocker locker(&lock); diff --git a/tests/auto/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp b/tests/auto/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp index 0fe6a5294d..f984aec0e8 100644 --- a/tests/auto/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp +++ b/tests/auto/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp @@ -214,7 +214,7 @@ void tst_QReadWriteLock::tryReadLock() class Thread : public QThread { public: - void run() + void run() override { testsTurn.release(); @@ -331,7 +331,7 @@ void tst_QReadWriteLock::tryWriteLock() { public: Thread() : failureCount(0) { } - void run() + void run() override { testsTurn.release(); @@ -416,7 +416,7 @@ class WriteLockThread : public QThread public: QReadWriteLock &testRwlock; inline WriteLockThread(QReadWriteLock &l) : testRwlock(l) { } - void run() + void run() override { testRwlock.lockForWrite(); testRwlock.unlock(); @@ -434,7 +434,7 @@ class ReadLockThread : public QThread public: QReadWriteLock &testRwlock; inline ReadLockThread(QReadWriteLock &l) : testRwlock(l) { } - void run() + void run() override { testRwlock.lockForRead(); testRwlock.unlock(); @@ -451,7 +451,7 @@ class WriteLockReleasableThread : public QThread public: QReadWriteLock &testRwlock; inline WriteLockReleasableThread(QReadWriteLock &l) : testRwlock(l) { } - void run() + void run() override { testRwlock.lockForWrite(); while (release.loadRelaxed() == false) { @@ -471,7 +471,7 @@ class ReadLockReleasableThread : public QThread public: QReadWriteLock &testRwlock; inline ReadLockReleasableThread(QReadWriteLock &l) : testRwlock(l) { } - void run() + void run() override { testRwlock.lockForRead(); while (release.loadRelaxed() == false) { @@ -505,7 +505,7 @@ public: ,waitTime(waitTime) ,print(print) { } - void run() + void run() override { t.start(); while (t.elapsed()<runTime) { @@ -541,7 +541,7 @@ public: ,waitTime(waitTime) ,print(print) { } - void run() + void run() override { t.start(); while (t.elapsed() < runTime) { @@ -578,7 +578,7 @@ public: ,waitTime(waitTime) ,maxval(maxval) { } - void run() + void run() override { t.start(); while (t.elapsed() < runTime) { @@ -618,7 +618,7 @@ public: ,runTime(runTime) ,waitTime(waitTime) { } - void run() + void run() override { t.start(); while (t.elapsed() < runTime) { @@ -845,7 +845,7 @@ class DeleteOnUnlockThread : public QThread public: DeleteOnUnlockThread(QReadWriteLock **lock, QWaitCondition *startup, QMutex *waitMutex) :m_lock(lock), m_startup(startup), m_waitMutex(waitMutex) {} - void run() + void run() override { m_waitMutex->lock(); m_startup->wakeAll(); @@ -943,7 +943,7 @@ void tst_QReadWriteLock::recursiveReadLock() QReadWriteLock *lock; bool tryLockForWriteResult; - void run() + void run() override { testsTurn.release(); @@ -1038,7 +1038,7 @@ void tst_QReadWriteLock::recursiveWriteLock() QReadWriteLock *lock; bool tryLockForReadResult; - void run() + void run() override { testsTurn.release(); diff --git a/tests/auto/corelib/thread/qsemaphore/tst_qsemaphore.cpp b/tests/auto/corelib/thread/qsemaphore/tst_qsemaphore.cpp index 7654d0e74b..cf27c23591 100644 --- a/tests/auto/corelib/thread/qsemaphore/tst_qsemaphore.cpp +++ b/tests/auto/corelib/thread/qsemaphore/tst_qsemaphore.cpp @@ -57,7 +57,7 @@ public: ThreadOne() {} protected: - void run() + void run() override { int i = 0; while ( i < 100 ) { @@ -76,7 +76,7 @@ public: ThreadN(int n) :N(n) { } protected: - void run() + void run() override { int i = 0; while ( i < 100 ) { @@ -400,7 +400,7 @@ void tst_QSemaphore::tryAcquireWithTimeoutStarvation() QSemaphore *semaphore; int amountToConsume, timeout; - void run() + void run() override { startup.release(); forever { @@ -497,7 +497,7 @@ QSemaphore usedSpace; class Producer : public QThread { public: - void run(); + void run() override; }; static const int Timeout = 60 * 1000; // 1min @@ -521,7 +521,7 @@ void Producer::run() class Consumer : public QThread { public: - void run(); + void run() override; }; void Consumer::run() diff --git a/tests/auto/corelib/thread/qthread/tst_qthread.cpp b/tests/auto/corelib/thread/qthread/tst_qthread.cpp index 3f2679831e..8cb846d98f 100644 --- a/tests/auto/corelib/thread/qthread/tst_qthread.cpp +++ b/tests/auto/corelib/thread/qthread/tst_qthread.cpp @@ -142,7 +142,7 @@ public: Qt::HANDLE id; QThread *thread; - void run() + void run() override { id = QThread::currentThreadId(); thread = QThread::currentThread(); @@ -155,7 +155,7 @@ public: QMutex mutex; QWaitCondition cond; - void run() + void run() override { QMutexLocker locker(&mutex); cond.wakeOne(); @@ -180,7 +180,7 @@ public: int code; int result; - void run() + void run() override { Simple_Thread::run(); if (object) { @@ -195,7 +195,7 @@ public: class Terminate_Thread : public Simple_Thread { public: - void run() + void run() override { setTerminationEnabled(false); { @@ -224,7 +224,7 @@ public: Quit_Object *object; int result; - void run() + void run() override { Simple_Thread::run(); if (object) { @@ -245,7 +245,7 @@ public: int elapsed; // result, in *MILLISECONDS* - void run() + void run() override { QMutexLocker locker(&mutex); @@ -563,7 +563,7 @@ void tst_QThread::exec() MultipleExecThread() : res1(-2), res2(-2) { } - void run() + void run() override { { Exit_Object o; @@ -1002,7 +1002,8 @@ void tst_QThread::exitAndExec() QSemaphore sem1; QSemaphore sem2; volatile int value; - void run() { + void run() override + { sem1.acquire(); value = exec(); //First entrence sem2.release(); @@ -1053,7 +1054,7 @@ public: QWaitCondition cond1; QWaitCondition cond2; - void run() + void run() override { QMutexLocker locker(&mutex); cond1.wait(&mutex); @@ -1118,7 +1119,7 @@ void tst_QThread::wait3_slowDestructor() void tst_QThread::destroyFinishRace() { - class Thread : public QThread { void run() {} }; + class Thread : public QThread { void run() override {} }; for (int i = 0; i < 15; i++) { Thread *thr = new Thread; connect(thr, SIGNAL(finished()), thr, SLOT(deleteLater())); @@ -1138,7 +1139,8 @@ void tst_QThread::startFinishRace() class Thread : public QThread { public: Thread() : i (50) {} - void run() { + void run() override + { i--; if (!i) disconnect(this, SIGNAL(finished()), 0, 0); } @@ -1161,7 +1163,7 @@ void tst_QThread::startFinishRace() void tst_QThread::startAndQuitCustomEventLoop() { struct Thread : QThread { - void run() { QEventLoop().exec(); } + void run() override { QEventLoop().exec(); } }; for (int i = 0; i < 5; i++) { @@ -1213,21 +1215,21 @@ QT_END_NAMESPACE class DummyEventDispatcher : public QAbstractEventDispatcher { public: DummyEventDispatcher() : QAbstractEventDispatcher() {} - bool processEvents(QEventLoop::ProcessEventsFlags) { + bool processEvents(QEventLoop::ProcessEventsFlags) override { visited.storeRelaxed(true); emit awake(); QCoreApplication::sendPostedEvents(); return false; } - void registerSocketNotifier(QSocketNotifier *) {} - void unregisterSocketNotifier(QSocketNotifier *) {} - void registerTimer(int, int, Qt::TimerType, QObject *) {} - bool unregisterTimer(int ) { return false; } - bool unregisterTimers(QObject *) { return false; } - QList<TimerInfo> registeredTimers(QObject *) const { return QList<TimerInfo>(); } - int remainingTime(int) { return 0; } - void wakeUp() {} - void interrupt() {} + void registerSocketNotifier(QSocketNotifier *) override {} + void unregisterSocketNotifier(QSocketNotifier *) override {} + void registerTimer(int, int, Qt::TimerType, QObject *) override {} + bool unregisterTimer(int) override { return false; } + bool unregisterTimers(QObject *) override { return false; } + QList<TimerInfo> registeredTimers(QObject *) const override { return QList<TimerInfo>(); } + int remainingTime(int) override { return 0; } + void wakeUp() override {} + void interrupt() override {} #ifdef Q_OS_WIN bool registerEventNotifier(QWinEventNotifier *) { return false; } diff --git a/tests/auto/corelib/thread/qthreadonce/tst_qthreadonce.cpp b/tests/auto/corelib/thread/qthreadonce/tst_qthreadonce.cpp index 710288af9e..6859a55725 100644 --- a/tests/auto/corelib/thread/qthreadonce/tst_qthreadonce.cpp +++ b/tests/auto/corelib/thread/qthreadonce/tst_qthreadonce.cpp @@ -77,7 +77,7 @@ public: ~IncrementThread() { wait(); } protected: - void run() + void run() override { sem2.release(); sem1.acquire(); // synchronize 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(); diff --git a/tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp b/tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp index 737cb86c01..ab1dd677e9 100644 --- a/tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp +++ b/tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp @@ -129,7 +129,7 @@ public: : pointers(p) { } - void run() + void run() override { pointers.setLocalData(new Pointer); @@ -249,7 +249,7 @@ void tst_QThreadStorage::ensureCleanupOrder() : first(first), second(second) { } - void run() + void run() override { // set in reverse order, but shouldn't matter, the data // will be deleted in the order the thread storage objects @@ -340,7 +340,7 @@ void tst_QThreadStorage::leakInDestructor() Thread(QThreadStorage<ThreadStorageLocalDataTester *> &t) : tls(t) { } - void run() + void run() override { QVERIFY(!tls.hasLocalData()); tls.setLocalData(new ThreadStorageLocalDataTester); @@ -392,7 +392,7 @@ void tst_QThreadStorage::resetInDestructor() class Thread : public QThread { public: - void run() + void run() override { QVERIFY(!ThreadStorageResetLocalDataTesterTls()->hasLocalData()); ThreadStorageResetLocalDataTesterTls()->setLocalData(new ThreadStorageResetLocalDataTester); @@ -428,7 +428,8 @@ void tst_QThreadStorage::valueBased() Thread(QThreadStorage<SPointer> &t1, QThreadStorage<QString> &t2, QThreadStorage<int> &t3) : tlsSPointer(t1), tlsString(t2), tlsInt(t3) { } - void run() { + void run() override + { /*QVERIFY(!tlsSPointer.hasLocalData()); QVERIFY(!tlsString.hasLocalData()); QVERIFY(!tlsInt.hasLocalData());*/ diff --git a/tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp b/tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp index 5363231895..3fcac48788 100644 --- a/tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp +++ b/tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp @@ -77,7 +77,7 @@ public: inline wait_QMutex_Thread_1() { } - void run() + void run() override { mutex.lock(); cond.wakeOne(); @@ -98,7 +98,7 @@ public: : mutex(0), cond(0) { } - void run() + void run() override { mutex->lock(); started.wakeOne(); @@ -116,7 +116,7 @@ public: inline wait_QReadWriteLock_Thread_1() { } - void run() + void run() override { readWriteLock.lockForWrite(); cond.wakeOne(); @@ -137,7 +137,7 @@ public: : readWriteLock(0), cond(0) { } - void run() + void run() override { readWriteLock->lockForRead(); started.wakeOne(); @@ -398,7 +398,7 @@ public: static inline void sleep(ulong s) { QThread::sleep(s); } - void run() + void run() override { Q_ASSERT(count); Q_ASSERT(mutex); @@ -430,7 +430,7 @@ public: static inline void sleep(ulong s) { QThread::sleep(s); } - void run() + void run() override { Q_ASSERT(count); Q_ASSERT(readWriteLock); @@ -764,7 +764,8 @@ public: QWaitCondition *startup; QWaitCondition *waitCondition; - void run() { + void run() override + { mutex->lock(); ready = true; @@ -796,7 +797,8 @@ public: QWaitCondition *startup; QWaitCondition *waitCondition; - void run() { + void run() override + { readWriteLock->lockForWrite(); ready = true; diff --git a/tests/auto/corelib/thread/qwritelocker/tst_qwritelocker.cpp b/tests/auto/corelib/thread/qwritelocker/tst_qwritelocker.cpp index 876c18c721..3dc3c37961 100644 --- a/tests/auto/corelib/thread/qwritelocker/tst_qwritelocker.cpp +++ b/tests/auto/corelib/thread/qwritelocker/tst_qwritelocker.cpp @@ -73,7 +73,7 @@ void tst_QWriteLocker::scopeTest() class ScopeTestThread : public tst_QWriteLockerThread { public: - void run() + void run() override { waitForTest(); @@ -118,7 +118,7 @@ void tst_QWriteLocker::unlockAndRelockTest() class UnlockAndRelockThread : public tst_QWriteLockerThread { public: - void run() + void run() override { QWriteLocker locker(&lock); @@ -164,7 +164,7 @@ void tst_QWriteLocker::lockerStateTest() class LockerStateThread : public tst_QWriteLockerThread { public: - void run() + void run() override { { QWriteLocker locker(&lock); |