aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@digia.com>2012-12-19 16:18:52 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-12-20 15:44:48 +0100
commit920b949e5185258baabfb3f738b660b3c0f002e3 (patch)
tree702fa5cb06854a1c213e896fd38edbcf912d4731 /tests/auto/quick
parentad821a63bf4075f2b18ec9eaa6d58f8fd721269a (diff)
Fix compiler warnings in declarative tests.
- Unused variables - Missing enumeration values in switch - truncation from double to float - truncation from size_t to int - Missing initializers - Mix of operator & and bool | Change-Id: Ib212aeea41befef193f12300a1d9814a60f183af Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Diffstat (limited to 'tests/auto/quick')
-rw-r--r--tests/auto/quick/geometry/tst_geometry.cpp6
-rw-r--r--tests/auto/quick/qquickgridview/tst_qquickgridview.cpp1
-rw-r--r--tests/auto/quick/qquickimageprovider/tst_qquickimageprovider.cpp2
-rw-r--r--tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp3
-rw-r--r--tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp2
5 files changed, 7 insertions, 7 deletions
diff --git a/tests/auto/quick/geometry/tst_geometry.cpp b/tests/auto/quick/geometry/tst_geometry.cpp
index 8bf65d1638..fc5e921db5 100644
--- a/tests/auto/quick/geometry/tst_geometry.cpp
+++ b/tests/auto/quick/geometry/tst_geometry.cpp
@@ -139,9 +139,9 @@ void GeometryTest::testCustomGeometry()
};
static QSGGeometry::Attribute attributes[] = {
- { 0, 2, GL_FLOAT },
- { 1, 4, GL_UNSIGNED_BYTE },
- { 2, 4, GL_FLOAT },
+ { 0, 2, GL_FLOAT, 0, 0},
+ { 1, 4, GL_UNSIGNED_BYTE, 0, 0},
+ { 2, 4, GL_FLOAT, 0, 0},
};
static QSGGeometry::AttributeSet set = { 4, 6 * sizeof(float) + 4 * sizeof(unsigned char), attributes };
diff --git a/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp b/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp
index 37d96f4950..dc0db6d4ff 100644
--- a/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp
+++ b/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp
@@ -292,6 +292,7 @@ private:
}
void releaseView(QQuickView *view) {
Q_ASSERT(view == m_view);
+ Q_UNUSED(view)
m_view->setSource(QUrl());
}
#else
diff --git a/tests/auto/quick/qquickimageprovider/tst_qquickimageprovider.cpp b/tests/auto/quick/qquickimageprovider/tst_qquickimageprovider.cpp
index 64eb0a7f42..19b547944c 100644
--- a/tests/auto/quick/qquickimageprovider/tst_qquickimageprovider.cpp
+++ b/tests/auto/quick/qquickimageprovider/tst_qquickimageprovider.cpp
@@ -236,7 +236,7 @@ void tst_qquickimageprovider::runTest(bool async, QQuickImageProvider *provider)
// From this point on, treat forced async providers as async behaviour-wise
if (engine.imageProvider(QUrl(source).host()) == provider)
- async |= provider->flags() & QQuickImageProvider::ForceAsynchronousImageLoading;
+ async |= (provider->flags() & QQuickImageProvider::ForceAsynchronousImageLoading) != 0;
if (async)
QTRY_VERIFY(obj->status() == QQuickImage::Loading);
diff --git a/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp b/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp
index d6b501c619..76768ee395 100644
--- a/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp
+++ b/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp
@@ -1285,7 +1285,6 @@ void tst_QQuickMouseArea::pressedMultipleButtons()
QPoint point(10,10);
- int prevButtons = 0;
for (int i = 0; i < buttons.count(); ++i) {
int btns = buttons.at(i);
@@ -1294,8 +1293,6 @@ void tst_QQuickMouseArea::pressedMultipleButtons()
QCOMPARE(mouseArea->pressed(), pressed.at(i));
QCOMPARE(mouseArea->pressedButtons(), pressedButtons.at(i));
-
- prevButtons = buttons.at(i);
}
QTest::mousePress(view, Qt::NoButton, 0, point);
diff --git a/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp b/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp
index ea2ad71bfc..f8332d661d 100644
--- a/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp
+++ b/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp
@@ -2139,6 +2139,8 @@ void tst_qquicktextedit::positionAt()
case QQuickTextEdit::AlignRight:
xoff = texteditObject->width() - secondLine.naturalTextWidth();
break;
+ case QQuickTextEdit::AlignJustify:
+ break;
}
int pos = texteditObject->positionAt(texteditObject->width()/2, y0);