summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/io
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/io
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/io')
-rw-r--r--tests/auto/corelib/io/qabstractfileengine/tst_qabstractfileengine.cpp50
-rw-r--r--tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp4
-rw-r--r--tests/auto/corelib/io/qfile/tst_qfile.cpp58
-rw-r--r--tests/auto/corelib/io/qloggingcategory/tst_qloggingcategory.cpp2
-rw-r--r--tests/auto/corelib/io/qprocess-noapplication/tst_qprocessnoapplication.cpp2
-rw-r--r--tests/auto/corelib/io/qprocess/tst_qprocess.cpp2
6 files changed, 59 insertions, 59 deletions
diff --git a/tests/auto/corelib/io/qabstractfileengine/tst_qabstractfileengine.cpp b/tests/auto/corelib/io/qabstractfileengine/tst_qabstractfileengine.cpp
index 1671e9d98b..f85742354e 100644
--- a/tests/auto/corelib/io/qabstractfileengine/tst_qabstractfileengine.cpp
+++ b/tests/auto/corelib/io/qabstractfileengine/tst_qabstractfileengine.cpp
@@ -76,7 +76,7 @@ public:
{
}
- bool open(QIODevice::OpenMode openMode)
+ bool open(QIODevice::OpenMode openMode) override
{
if (openForRead_ || openForWrite_) {
qWarning("%s: file is already open for %s",
@@ -108,7 +108,7 @@ public:
return true;
}
- bool close()
+ bool close() override
{
openFile_.clear();
@@ -119,7 +119,7 @@ public:
return true;
}
- qint64 size() const
+ qint64 size() const override
{
QSharedPointer<File> file = resolveFile(false);
if (!file)
@@ -129,7 +129,7 @@ public:
return file->content.size();
}
- qint64 pos() const
+ qint64 pos() const override
{
if (!openForRead_ && !openForWrite_) {
qWarning("%s: file is not open", Q_FUNC_INFO);
@@ -138,7 +138,7 @@ public:
return position_;
}
- bool seek(qint64 pos)
+ bool seek(qint64 pos) override
{
if (!openForRead_ && !openForWrite_) {
qWarning("%s: file is not open", Q_FUNC_INFO);
@@ -153,7 +153,7 @@ public:
return false;
}
- bool flush()
+ bool flush() override
{
if (!openForRead_ && !openForWrite_) {
qWarning("%s: file is not open", Q_FUNC_INFO);
@@ -163,7 +163,7 @@ public:
return true;
}
- bool remove()
+ bool remove() override
{
QMutexLocker lock(&fileSystemMutex);
int count = fileSystem.remove(fileName_);
@@ -171,7 +171,7 @@ public:
return (count == 1);
}
- bool copy(const QString &newName)
+ bool copy(const QString &newName) override
{
QMutexLocker lock(&fileSystemMutex);
if (!fileSystem.contains(fileName_)
@@ -182,7 +182,7 @@ public:
return true;
}
- bool rename(const QString &newName)
+ bool rename(const QString &newName) override
{
QMutexLocker lock(&fileSystemMutex);
if (!fileSystem.contains(fileName_)
@@ -215,7 +215,7 @@ public:
// return false;
// }
- bool setSize(qint64 size)
+ bool setSize(qint64 size) override
{
if (size < 0)
return false;
@@ -234,7 +234,7 @@ public:
return (file->content.size() == size);
}
- FileFlags fileFlags(FileFlags type) const
+ FileFlags fileFlags(FileFlags type) const override
{
QSharedPointer<File> file = resolveFile(false);
if (file) {
@@ -252,7 +252,7 @@ public:
// return false;
// }
- QString fileName(FileName file) const
+ QString fileName(FileName file) const override
{
switch (file) {
case DefaultName:
@@ -281,7 +281,7 @@ public:
return QString();
}
- uint ownerId(FileOwner owner) const
+ uint ownerId(FileOwner owner) const override
{
QSharedPointer<File> file = resolveFile(false);
if (file) {
@@ -302,7 +302,7 @@ public:
return -2;
}
- QString owner(FileOwner owner) const
+ QString owner(FileOwner owner) const override
{
QSharedPointer<File> file = resolveFile(false);
if (file) {
@@ -335,7 +335,7 @@ public:
return QString();
}
- QDateTime fileTime(FileTime time) const
+ QDateTime fileTime(FileTime time) const override
{
QSharedPointer<File> file = resolveFile(false);
if (file) {
@@ -355,14 +355,14 @@ public:
return QDateTime();
}
- bool setFileTime(const QDateTime &newDate, FileTime time)
+ bool setFileTime(const QDateTime &newDate, FileTime time) override
{
Q_UNUSED(newDate);
Q_UNUSED(time);
return false;
}
- void setFileName(const QString &file)
+ void setFileName(const QString &file) override
{
if (openForRead_ || openForWrite_)
qWarning("%s: Can't set file name while file is open", Q_FUNC_INFO);
@@ -384,7 +384,7 @@ public:
// return 0;
// }
- qint64 read(char *data, qint64 maxLen)
+ qint64 read(char *data, qint64 maxLen) override
{
if (!openForRead_) {
qWarning("%s: file must be open for reading", Q_FUNC_INFO);
@@ -407,7 +407,7 @@ public:
return readSize;
}
- qint64 write(const char *data, qint64 length)
+ qint64 write(const char *data, qint64 length) override
{
if (!openForWrite_) {
qWarning("%s: file must be open for writing", Q_FUNC_INFO);
@@ -508,15 +508,15 @@ public:
names.append("bar");
index = -1;
}
- QString currentFileName() const
+ QString currentFileName() const override
{
return names.at(index);
}
- bool hasNext() const
+ bool hasNext() const override
{
return index < names.size() - 1;
}
- QString next()
+ QString next() override
{
if (!hasNext())
return QString();
@@ -530,11 +530,11 @@ public:
: QFSFileEngine(fileName)
{
}
- Iterator *beginEntryList(QDir::Filters filters, const QStringList &filterNames)
+ Iterator *beginEntryList(QDir::Filters filters, const QStringList &filterNames) override
{
return new Iterator(filters, filterNames);
}
- FileFlags fileFlags(FileFlags type) const
+ FileFlags fileFlags(FileFlags type) const override
{
if (fileName(DefaultName).endsWith(".tar")) {
FileFlags ret = QFSFileEngine::fileFlags(type);
@@ -556,7 +556,7 @@ QHash<QString, QSharedPointer<ReferenceFileEngine::File> > ReferenceFileEngine::
class FileEngineHandler
: QAbstractFileEngineHandler
{
- QAbstractFileEngine *create(const QString &fileName) const
+ QAbstractFileEngine *create(const QString &fileName) const override
{
if (fileName.endsWith(".tar") || fileName.contains(".tar/"))
return new MountingFileEngine(fileName);
diff --git a/tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp b/tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp
index 24e6128b4d..c18354d840 100644
--- a/tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp
+++ b/tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp
@@ -477,14 +477,14 @@ public:
: QFSFileEngine(fileName)
{ }
- QAbstractFileEngineIterator *beginEntryList(QDir::Filters, const QStringList &)
+ QAbstractFileEngineIterator *beginEntryList(QDir::Filters, const QStringList &) override
{ return 0; }
};
class EngineWithNoIteratorHandler : public QAbstractFileEngineHandler
{
public:
- QAbstractFileEngine *create(const QString &fileName) const
+ QAbstractFileEngine *create(const QString &fileName) const override
{
return new EngineWithNoIterator(fileName);
}
diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp
index b81ed67764..e5b7051997 100644
--- a/tests/auto/corelib/io/qfile/tst_qfile.cpp
+++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp
@@ -2181,33 +2181,33 @@ public:
MyEngine(int n) { number = n; }
virtual ~MyEngine() {}
- void setFileName(const QString &) {}
- bool open(QIODevice::OpenMode) { return false; }
- bool close() { return false; }
- bool flush() { return false; }
- qint64 size() const { return 123 + number; }
+ void setFileName(const QString &) override {}
+ bool open(QIODevice::OpenMode) override { return false; }
+ bool close() override { return false; }
+ bool flush() override { return false; }
+ qint64 size() const override { return 123 + number; }
qint64 at() const { return -1; }
- bool seek(qint64) { return false; }
- bool isSequential() const { return false; }
- qint64 read(char *, qint64) { return -1; }
- qint64 write(const char *, qint64) { return -1; }
- bool remove() { return false; }
- bool copy(const QString &) { return false; }
- bool rename(const QString &) { return false; }
- bool link(const QString &) { return false; }
- bool mkdir(const QString &, bool) const { return false; }
- bool rmdir(const QString &, bool) const { return false; }
- bool setSize(qint64) { return false; }
- QStringList entryList(QDir::Filters, const QStringList &) const { return QStringList(); }
- bool caseSensitive() const { return false; }
- bool isRelativePath() const { return false; }
- FileFlags fileFlags(FileFlags) const { return { }; }
+ bool seek(qint64) override { return false; }
+ bool isSequential() const override { return false; }
+ qint64 read(char *, qint64) override { return -1; }
+ qint64 write(const char *, qint64) override { return -1; }
+ bool remove() override { return false; }
+ bool copy(const QString &) override { return false; }
+ bool rename(const QString &) override { return false; }
+ bool link(const QString &) override { return false; }
+ bool mkdir(const QString &, bool) const override { return false; }
+ bool rmdir(const QString &, bool) const override { return false; }
+ bool setSize(qint64) override { return false; }
+ QStringList entryList(QDir::Filters, const QStringList &) const override { return QStringList(); }
+ bool caseSensitive() const override { return false; }
+ bool isRelativePath() const override { return false; }
+ FileFlags fileFlags(FileFlags) const override { return { }; }
bool chmod(uint) { return false; }
- QString fileName(FileName) const { return name; }
- uint ownerId(FileOwner) const { return 0; }
- QString owner(FileOwner) const { return QString(); }
- QDateTime fileTime(FileTime) const { return QDateTime(); }
- bool setFileTime(const QDateTime &, FileTime) { return false; }
+ QString fileName(FileName) const override { return name; }
+ uint ownerId(FileOwner) const override { return 0; }
+ QString owner(FileOwner) const override { return QString(); }
+ QDateTime fileTime(FileTime) const override { return QDateTime(); }
+ bool setFileTime(const QDateTime &, FileTime) override { return false; }
private:
int number;
@@ -2217,7 +2217,7 @@ private:
class MyHandler : public QAbstractFileEngineHandler
{
public:
- inline QAbstractFileEngine *create(const QString &) const
+ inline QAbstractFileEngine *create(const QString &) const override
{
return new MyEngine(1);
}
@@ -2226,7 +2226,7 @@ public:
class MyHandler2 : public QAbstractFileEngineHandler
{
public:
- inline QAbstractFileEngine *create(const QString &) const
+ inline QAbstractFileEngine *create(const QString &) const override
{
return new MyEngine(2);
}
@@ -2257,7 +2257,7 @@ void tst_QFile::fileEngineHandler()
class MyRecursiveHandler : public QAbstractFileEngineHandler
{
public:
- inline QAbstractFileEngine *create(const QString &fileName) const
+ inline QAbstractFileEngine *create(const QString &fileName) const override
{
if (fileName.startsWith(":!")) {
QDir dir;
@@ -2671,7 +2671,7 @@ void tst_QFile::renameWithAtEndSpecialFile() const
class PeculiarAtEnd : public QFile
{
public:
- virtual bool atEnd() const
+ virtual bool atEnd() const override
{
return true;
}
diff --git a/tests/auto/corelib/io/qloggingcategory/tst_qloggingcategory.cpp b/tests/auto/corelib/io/qloggingcategory/tst_qloggingcategory.cpp
index 79ac6b0fc4..cc73eac9c8 100644
--- a/tests/auto/corelib/io/qloggingcategory/tst_qloggingcategory.cpp
+++ b/tests/auto/corelib/io/qloggingcategory/tst_qloggingcategory.cpp
@@ -133,7 +133,7 @@ public:
: _logtext(logtext), _configuration(configuration)
{}
protected:
- void run()
+ void run() override
{
for (int i = 0; i < 2000; i++) {
_configuration->addKey("Digia*", true);
diff --git a/tests/auto/corelib/io/qprocess-noapplication/tst_qprocessnoapplication.cpp b/tests/auto/corelib/io/qprocess-noapplication/tst_qprocessnoapplication.cpp
index b9702a93cf..ae53559de7 100644
--- a/tests/auto/corelib/io/qprocess-noapplication/tst_qprocessnoapplication.cpp
+++ b/tests/auto/corelib/io/qprocess-noapplication/tst_qprocessnoapplication.cpp
@@ -49,7 +49,7 @@ void tst_QProcessNoApplication::initializationDeadlock()
struct MyThread : public QThread
{
- void run()
+ void run() override
{
// what we execute does not matter, as long as we try to
// and that the process exits
diff --git a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp
index 023e254dc5..1570bb9977 100644
--- a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp
+++ b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp
@@ -1192,7 +1192,7 @@ public:
}
protected:
- inline void run()
+ inline void run() override
{
exitCode = 90210;