summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/thread/qthread/tst_qthread.cpp
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/qthread/tst_qthread.cpp
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/qthread/tst_qthread.cpp')
-rw-r--r--tests/auto/corelib/thread/qthread/tst_qthread.cpp46
1 files changed, 24 insertions, 22 deletions
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; }