diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-02-01 10:24:10 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-02-02 12:06:05 +0100 |
commit | bde773ec6a0d9319bd8cebf138513afd79c2eef7 (patch) | |
tree | 9cfb89a31d66b6f8849ad0e37d2aee9572cf6a67 /tests/auto | |
parent | fce101913313f7705831bb5de10dbbab46e5b3a0 (diff) |
Fix a few compiler warnings in tests
Change-Id: I22f6ac8ed02dd4ef4083ce3c781552623a0b08da
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'tests/auto')
4 files changed, 9 insertions, 8 deletions
diff --git a/tests/auto/concurrent/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp b/tests/auto/concurrent/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp index e58eb68cea..c365ec4837 100644 --- a/tests/auto/concurrent/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp +++ b/tests/auto/concurrent/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp @@ -421,7 +421,7 @@ public: this->blockThread = blockThread; } - ThreadFunctionResult threadFunction() + ThreadFunctionResult threadFunction() override { QTest::qSleep(50); throw QException(); @@ -439,7 +439,7 @@ public: this->blockThread = blockThread; } - ThreadFunctionResult threadFunction() + ThreadFunctionResult threadFunction() override { QTest::qSleep(50); throw int(); diff --git a/tests/auto/gui/kernel/qfileopenevent/test/tst_qfileopenevent.cpp b/tests/auto/gui/kernel/qfileopenevent/test/tst_qfileopenevent.cpp index 0e5c7927e0..31cb036515 100644 --- a/tests/auto/gui/kernel/qfileopenevent/test/tst_qfileopenevent.cpp +++ b/tests/auto/gui/kernel/qfileopenevent/test/tst_qfileopenevent.cpp @@ -204,9 +204,9 @@ bool tst_qfileopenevent::event(QEvent *event) void tst_qfileopenevent::sendAndReceive() { - QScopedPointer<QFileOpenEvent> event(createFileAndEvent(QLatin1String("testSendAndReceive"), QByteArray("sending"))); + std::unique_ptr<QFileOpenEvent> event(createFileAndEvent(QLatin1String("testSendAndReceive"), QByteArray("sending"))); - QCoreApplication::instance()->postEvent(this, event.take()); + QCoreApplication::instance()->postEvent(this, event.release()); QCoreApplication::instance()->processEvents(); // QTBUG-17468: On Mac, processEvents doesn't always process posted events diff --git a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp index a5559cab70..68beef7d68 100644 --- a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp +++ b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp @@ -839,7 +839,7 @@ class Client : public QThread { public: - void run() + void run() override { QString testLine = "test"; LocalSocket socket; @@ -864,7 +864,7 @@ public: int clients; QMutex mutex; QWaitCondition wc; - void run() + void run() override { QString testLine = "test"; LocalServer server; @@ -1219,7 +1219,8 @@ class WriteThread : public QThread { Q_OBJECT public: - void run() { + void run() override + { QLocalSocket socket; socket.connectToServer("qlocalsocket_readyread"); diff --git a/tests/auto/sql/models/qsqlquerymodel/tst_qsqlquerymodel.cpp b/tests/auto/sql/models/qsqlquerymodel/tst_qsqlquerymodel.cpp index ac94961a84..f323c8b984 100644 --- a/tests/auto/sql/models/qsqlquerymodel/tst_qsqlquerymodel.cpp +++ b/tests/auto/sql/models/qsqlquerymodel/tst_qsqlquerymodel.cpp @@ -99,7 +99,7 @@ class DBTestModel: public QSqlQueryModel { public: DBTestModel(QObject *parent = nullptr): QSqlQueryModel(parent) {} - QModelIndex indexInQuery(const QModelIndex &item) const { return QSqlQueryModel::indexInQuery(item); } + QModelIndex indexInQuery(const QModelIndex &item) const override { return QSqlQueryModel::indexInQuery(item); } }; tst_QSqlQueryModel::tst_QSqlQueryModel() |