summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2020-07-26 19:41:23 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2020-07-29 14:33:29 +0200
commit9023791a45d11ec170e07f21bd106075c86dd3dc (patch)
tree83c79c87f2ff18ec9de85d4c8cc2e1eb7166793c /tests
parent6f17509ad9044c689e22719c6c4d1f7f88e4c954 (diff)
Fix warnings about unused expression results in tests
Change-Id: I401ec8a3742a5bb51a1b8b291c53395c3880117c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp16
-rw-r--r--tests/auto/corelib/tools/qexplicitlyshareddatapointer/tst_qexplicitlyshareddatapointer.cpp12
-rw-r--r--tests/auto/corelib/tools/qscopedpointer/tst_qscopedpointer.cpp4
3 files changed, 16 insertions, 16 deletions
diff --git a/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp
index c214c75d52..5ca89c7dc1 100644
--- a/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp
+++ b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp
@@ -858,14 +858,14 @@ void tst_QMimeDatabase::fromThreads()
QThreadPool tp;
tp.setMaxThreadCount(20);
// Note that data-based tests cannot be used here (QTest::fetchData asserts).
- QtConcurrent::run(&tp, &tst_QMimeDatabase::mimeTypeForName, this);
- QtConcurrent::run(&tp, &tst_QMimeDatabase::aliases, this);
- QtConcurrent::run(&tp, &tst_QMimeDatabase::allMimeTypes, this);
- QtConcurrent::run(&tp, &tst_QMimeDatabase::icons, this);
- QtConcurrent::run(&tp, &tst_QMimeDatabase::inheritance, this);
- QtConcurrent::run(&tp, &tst_QMimeDatabase::knownSuffix, this);
- QtConcurrent::run(&tp, &tst_QMimeDatabase::mimeTypeForFileWithContent, this);
- QtConcurrent::run(&tp, &tst_QMimeDatabase::allMimeTypes, this); // a second time
+ Q_UNUSED(QtConcurrent::run(&tp, &tst_QMimeDatabase::mimeTypeForName, this));
+ Q_UNUSED(QtConcurrent::run(&tp, &tst_QMimeDatabase::aliases, this));
+ Q_UNUSED(QtConcurrent::run(&tp, &tst_QMimeDatabase::allMimeTypes, this));
+ Q_UNUSED(QtConcurrent::run(&tp, &tst_QMimeDatabase::icons, this));
+ Q_UNUSED(QtConcurrent::run(&tp, &tst_QMimeDatabase::inheritance, this));
+ Q_UNUSED(QtConcurrent::run(&tp, &tst_QMimeDatabase::knownSuffix, this));
+ Q_UNUSED(QtConcurrent::run(&tp, &tst_QMimeDatabase::mimeTypeForFileWithContent, this));
+ Q_UNUSED(QtConcurrent::run(&tp, &tst_QMimeDatabase::allMimeTypes, this)); // a second time
QVERIFY(tp.waitForDone(60000));
}
diff --git a/tests/auto/corelib/tools/qexplicitlyshareddatapointer/tst_qexplicitlyshareddatapointer.cpp b/tests/auto/corelib/tools/qexplicitlyshareddatapointer/tst_qexplicitlyshareddatapointer.cpp
index e89e634841..7c1e90f5d4 100644
--- a/tests/auto/corelib/tools/qexplicitlyshareddatapointer/tst_qexplicitlyshareddatapointer.cpp
+++ b/tests/auto/corelib/tools/qexplicitlyshareddatapointer/tst_qexplicitlyshareddatapointer.cpp
@@ -169,7 +169,7 @@ void tst_QExplicitlySharedDataPointer::data() const
pointer.data();
/* Check that this cast is possible. */
- static_cast<const MyClass *>(pointer.data());
+ Q_UNUSED(static_cast<const MyClass *>(pointer.data()));
QVERIFY(! (pointer == nullptr));
QVERIFY(! (nullptr == pointer));
@@ -181,7 +181,7 @@ void tst_QExplicitlySharedDataPointer::data() const
pointer.data();
/* Check that this cast is possible. */
- static_cast<const MyClass *>(pointer.data());
+ Q_UNUSED(static_cast<const MyClass *>(pointer.data()));
}
/* Must not mutate the pointer. */
@@ -190,8 +190,8 @@ void tst_QExplicitlySharedDataPointer::data() const
pointer.data();
/* Check that these casts are possible. */
- static_cast<MyClass *>(pointer.data());
- static_cast<const MyClass *>(pointer.data());
+ Q_UNUSED(static_cast<MyClass *>(pointer.data()));
+ Q_UNUSED(static_cast<const MyClass *>(pointer.data()));
}
/* Must not mutate the pointer. */
@@ -200,8 +200,8 @@ void tst_QExplicitlySharedDataPointer::data() const
pointer.data();
/* Check that these casts are possible. */
- static_cast<MyClass *>(pointer.data());
- static_cast<const MyClass *>(pointer.data());
+ Q_UNUSED(static_cast<MyClass *>(pointer.data()));
+ Q_UNUSED(static_cast<const MyClass *>(pointer.data()));
}
}
diff --git a/tests/auto/corelib/tools/qscopedpointer/tst_qscopedpointer.cpp b/tests/auto/corelib/tools/qscopedpointer/tst_qscopedpointer.cpp
index ea94cc2999..9c90b44e87 100644
--- a/tests/auto/corelib/tools/qscopedpointer/tst_qscopedpointer.cpp
+++ b/tests/auto/corelib/tools/qscopedpointer/tst_qscopedpointer.cpp
@@ -252,7 +252,7 @@ void tst_QScopedPointer::negationOperatorSignature()
!p;
/* The return value should be bool. */
- static_cast<bool>(!p);
+ Q_UNUSED(static_cast<bool>(!p));
}
void tst_QScopedPointer::operatorBool()
@@ -302,7 +302,7 @@ void tst_QScopedPointer::isNullSignature()
const QScopedPointer<int> p(new int(69));
/* The signature should be const and return bool. */
- static_cast<bool>(p.isNull());
+ Q_UNUSED(static_cast<bool>(p.isNull()));
}
void tst_QScopedPointer::objectSize()