summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2020-07-26 17:38:14 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2020-07-26 18:06:46 +0200
commitbd3088ceb322381ac33bda11554667f1c9a421f8 (patch)
treee6b8eed1b083d2ff62c79a0b7a1d77217f3fff95 /tests
parentf418a96f9b7f003738894d0c19e176b2abc457df (diff)
Fix warnings about unused variables and functions in tests
Change-Id: Ia758a91384083c13fb4d743f500fef7a6629dfd5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/thread/qmutex/tst_qmutex.cpp1
-rw-r--r--tests/auto/corelib/tools/collections/tst_collections.cpp4
-rw-r--r--tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp16
-rw-r--r--tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp5
-rw-r--r--tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp10
-rw-r--r--tests/auto/gui/rhi/qrhi/tst_qrhi.cpp2
-rw-r--r--tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp1
-rw-r--r--tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp2
-rw-r--r--tests/auto/widgets/styles/qmacstyle/tst_qmacstyle.cpp11
-rw-r--r--tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp2
10 files changed, 7 insertions, 47 deletions
diff --git a/tests/auto/corelib/thread/qmutex/tst_qmutex.cpp b/tests/auto/corelib/thread/qmutex/tst_qmutex.cpp
index 11f34343ab..6603e5d7ce 100644
--- a/tests/auto/corelib/thread/qmutex/tst_qmutex.cpp
+++ b/tests/auto/corelib/thread/qmutex/tst_qmutex.cpp
@@ -715,7 +715,6 @@ void tst_QMutex::try_lock_for_recursive()
public:
void run()
{
- const std::chrono::milliseconds systemTimersResolutionAsDuration(systemTimersResolution);
testsTurn.release();
threadsTurn.acquire();
diff --git a/tests/auto/corelib/tools/collections/tst_collections.cpp b/tests/auto/corelib/tools/collections/tst_collections.cpp
index 748b32fb30..2cab6312aa 100644
--- a/tests/auto/corelib/tools/collections/tst_collections.cpp
+++ b/tests/auto/corelib/tools/collections/tst_collections.cpp
@@ -2737,14 +2737,12 @@ void instantiatePairAssociative()
{
instantiateMutableIterationContainer<ContainerType, KeyType>();
- typename ContainerType::iterator it;
- typename ContainerType::const_iterator constIt;
const KeyType key = KeyType();
const ValueType value = ValueType();
ContainerType container;
const ContainerType constContainer(container);
- it = container.insert(key, value);
+ auto it = container.insert(key, value);
container.erase(it);
container.find(key);
container.constFind(key);
diff --git a/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp b/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp
index ccba312807..6e32ba8039 100644
--- a/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp
+++ b/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp
@@ -1041,22 +1041,6 @@ void tst_QArrayData::arrayOps2()
Q_DECLARE_METATYPE(QArrayDataPointer<int>)
-static inline bool arrayIsFilledWith(const QArrayDataPointer<int> &array,
- int fillValue, size_t size)
-{
- const int *iter = array->begin();
- const int *const end = array->end();
-
- for (size_t i = 0; i < size; ++i, ++iter)
- if (*iter != fillValue)
- return false;
-
- if (iter != end)
- return false;
-
- return true;
-}
-
struct ResetOnDtor
{
ResetOnDtor()
diff --git a/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp b/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp
index c2639fa209..c1272dc4cf 100644
--- a/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp
+++ b/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp
@@ -77,11 +77,6 @@ static bool operator<(const MacSpecialKey &entry, int key)
return entry.key < key;
}
-static bool operator<(int key, const MacSpecialKey &entry)
-{
- return key < entry.key;
-}
-
static const MacSpecialKey * const MacSpecialKeyEntriesEnd = entries + NumEntries;
static QChar macSymbolForQtKey(int key)
diff --git a/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp b/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp
index 161ff5d3b7..af687f8cf1 100644
--- a/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp
+++ b/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp
@@ -955,18 +955,12 @@ void tst_QPainterPath::operators()
QCOMPARE(test, expected);
}
-static inline bool pathFuzzyCompare(double p1, double p2)
+template <typename T>
+static inline bool pathFuzzyCompare(T p1, T p2)
{
return qAbs(p1 - p2) < 0.001;
}
-
-static inline bool pathFuzzyCompare(float p1, float p2)
-{
- return qAbs(p1 - p2) < 0.001;
-}
-
-
void tst_QPainterPath::testArcMoveTo()
{
QFETCH(QRectF, rect);
diff --git a/tests/auto/gui/rhi/qrhi/tst_qrhi.cpp b/tests/auto/gui/rhi/qrhi/tst_qrhi.cpp
index ee14116e1c..f5e178de4b 100644
--- a/tests/auto/gui/rhi/qrhi/tst_qrhi.cpp
+++ b/tests/auto/gui/rhi/qrhi/tst_qrhi.cpp
@@ -475,13 +475,13 @@ void tst_QRhi::nativeHandles()
rt->setRenderPassDescriptor(rpDesc.data());
QVERIFY(rt->create());
- const QRhiNativeHandles *rpHandles = rpDesc->nativeHandles();
switch (impl) {
case QRhi::Null:
break;
#ifdef TST_VK
case QRhi::Vulkan:
{
+ const QRhiNativeHandles *rpHandles = rpDesc->nativeHandles();
const QRhiVulkanRenderPassNativeHandles *vkHandles = static_cast<const QRhiVulkanRenderPassNativeHandles *>(rpHandles);
QVERIFY(vkHandles);
QVERIFY(vkHandles->renderPass);
diff --git a/tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp b/tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp
index cdc04f33a0..f58fdc9bf9 100644
--- a/tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp
+++ b/tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp
@@ -859,7 +859,6 @@ void tst_QSqlTableModel::insertRowFailure()
values.setGenerated(1, true);
// populate 1 row
- const QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db);
QVERIFY_SQL(model, insertRecord(0, values));
QVERIFY_SQL(model, submitAll());
QVERIFY_SQL(model, select());
diff --git a/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp b/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp
index 91d0c07efd..fa374ee076 100644
--- a/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp
+++ b/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp
@@ -359,7 +359,7 @@ void tst_QDialog::showSizeGrip()
{
QDialog dialog(nullptr);
dialog.show();
- QWidget *ext = new QWidget(&dialog);
+ new QWidget(&dialog);
QVERIFY(!dialog.isSizeGripEnabled());
dialog.setSizeGripEnabled(true);
diff --git a/tests/auto/widgets/styles/qmacstyle/tst_qmacstyle.cpp b/tests/auto/widgets/styles/qmacstyle/tst_qmacstyle.cpp
index a78ebdb2b9..8f18c8a756 100644
--- a/tests/auto/widgets/styles/qmacstyle/tst_qmacstyle.cpp
+++ b/tests/auto/widgets/styles/qmacstyle/tst_qmacstyle.cpp
@@ -31,8 +31,6 @@
#include <QtWidgets>
#include <private/qstylehelper_p.h>
-const int N = 1;
-
Q_DECLARE_METATYPE(QStyleHelper::WidgetSizePolicy);
#define CT(E) \
@@ -40,22 +38,13 @@ Q_DECLARE_METATYPE(QStyleHelper::WidgetSizePolicy);
typedef QSizePolicy::ControlType ControlType;
-CT(DefaultType)
CT(ButtonBox)
CT(CheckBox)
CT(ComboBox)
-CT(Frame)
-CT(GroupBox)
CT(Label)
-CT(Line)
CT(LineEdit)
CT(PushButton)
CT(RadioButton)
-CT(Slider)
-CT(SpinBox)
-CT(TabWidget)
-CT(ToolButton)
-
class tst_QMacStyle : public QObject
{
diff --git a/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp b/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp
index 2ea5b70ed0..8def1a11fc 100644
--- a/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp
+++ b/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp
@@ -608,10 +608,12 @@ void tst_QMdiArea::showWindows()
//#define USE_SHOW
+#if !defined(Q_OS_DARWIN)
static inline QString windowTitle(const QString &t, const QString &f)
{
return t + QLatin1String(" - [") + f + QLatin1Char(']');
}
+#endif
void tst_QMdiArea::changeWindowTitle()
{