aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml
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/qml
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/qml')
-rw-r--r--tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp2
-rw-r--r--tests/auto/qml/qqmlconnections/tst_qqmlconnections.cpp2
-rw-r--r--tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp1
-rw-r--r--tests/auto/qml/qqmlinstruction/tst_qqmlinstruction.cpp14
-rw-r--r--tests/auto/qml/qqmllanguage/testtypes.h2
-rw-r--r--tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp11
-rw-r--r--tests/auto/qml/qqmlqt/tst_qqmlqt.cpp16
7 files changed, 24 insertions, 24 deletions
diff --git a/tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp b/tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp
index 5848b42028..92f48f398f 100644
--- a/tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp
+++ b/tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp
@@ -85,7 +85,7 @@ private slots:
void reloadQmlWindow();
};
-void tst_QQmlInspector::startQmlsceneProcess(const char *qmlFile)
+void tst_QQmlInspector::startQmlsceneProcess(const char * /* qmlFile */)
{
const QString argument = "-qmljsdebugger=port:" STR_PORT ",block";
diff --git a/tests/auto/qml/qqmlconnections/tst_qqmlconnections.cpp b/tests/auto/qml/qqmlconnections/tst_qqmlconnections.cpp
index b9e31d2216..a7ef405aa3 100644
--- a/tests/auto/qml/qqmlconnections/tst_qqmlconnections.cpp
+++ b/tests/auto/qml/qqmlconnections/tst_qqmlconnections.cpp
@@ -231,7 +231,7 @@ class TestObject : public QObject
Q_PROPERTY(bool ran READ ran WRITE setRan)
public:
- TestObject(QObject *parent = 0) : m_ran(false) {}
+ TestObject(QObject *parent = 0) : QObject(parent), m_ran(false) {}
~TestObject() {}
bool ran() const { return m_ran; }
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
index 1cf8e13c3c..bca76a7bc9 100644
--- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
+++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
@@ -3801,6 +3801,7 @@ void tst_qqmlecmascript::verifyContextLifetime(QQmlContextData *ctxt) {
v8::Persistent<v8::Context> context = v8::Context::New();
v8::Context::Scope context_scope(context);
v8::Local<v8::Object> temporaryScope = engine->qmlScope(scriptContext, NULL);
+ Q_UNUSED(temporaryScope)
context.Dispose();
}
diff --git a/tests/auto/qml/qqmlinstruction/tst_qqmlinstruction.cpp b/tests/auto/qml/qqmlinstruction/tst_qqmlinstruction.cpp
index 7d27751e77..591d4722e2 100644
--- a/tests/auto/qml/qqmlinstruction/tst_qqmlinstruction.cpp
+++ b/tests/auto/qml/qqmlinstruction/tst_qqmlinstruction.cpp
@@ -128,14 +128,14 @@ void tst_qqmlinstruction::dump()
{
QQmlCompiledData::Instruction::StoreFloat i;
i.propertyIndex = 3;
- i.value = 11.3;
+ i.value = 11.3f;
data->addInstruction(i);
}
{
QQmlCompiledData::Instruction::StoreDouble i;
i.propertyIndex = 4;
- i.value = 14.8;
+ i.value = 14.8f;
data->addInstruction(i);
}
@@ -676,8 +676,8 @@ void tst_qqmlinstruction::vector3d()
QCOMPARE(Q_ALIGNOF(QQmlInstruction::instr_storeVector3D::QVector3D), Q_ALIGNOF(QVector3D));
QQmlInstruction i;
- i.storeVector3D.vector.xp = 8.2;
- i.storeVector3D.vector.yp = 99.3;
+ i.storeVector3D.vector.xp = 8.2f;
+ i.storeVector3D.vector.yp = 99.3f;
i.storeVector3D.vector.zp = 12.0;
const QVector3D &vector = (const QVector3D &)(i.storeVector3D.vector);
@@ -692,10 +692,10 @@ void tst_qqmlinstruction::vector4d()
QCOMPARE(Q_ALIGNOF(QQmlInstruction::instr_storeVector4D::QVector4D), Q_ALIGNOF(QVector4D));
QQmlInstruction i;
- i.storeVector4D.vector.xp = 8.2;
- i.storeVector4D.vector.yp = 99.3;
+ i.storeVector4D.vector.xp = 8.2f;
+ i.storeVector4D.vector.yp = 99.3f;
i.storeVector4D.vector.zp = 12.0;
- i.storeVector4D.vector.wp = 121.1;
+ i.storeVector4D.vector.wp = 121.1f;
const QVector4D &vector = (const QVector4D &)(i.storeVector4D.vector);
QCOMPARE(vector.x(), (qreal)(float)8.2);
diff --git a/tests/auto/qml/qqmllanguage/testtypes.h b/tests/auto/qml/qqmllanguage/testtypes.h
index bd6205cbdf..e83e9e11ac 100644
--- a/tests/auto/qml/qqmllanguage/testtypes.h
+++ b/tests/auto/qml/qqmllanguage/testtypes.h
@@ -939,7 +939,7 @@ class MyUncreateableBaseClass : public QObject
Q_PROPERTY(bool prop2 READ prop2 WRITE setprop2 REVISION 1)
Q_PROPERTY(bool prop3 READ prop3 WRITE setprop3 REVISION 1)
public:
- explicit MyUncreateableBaseClass(bool arg, QObject *parent = 0)
+ explicit MyUncreateableBaseClass(bool /* arg */, QObject *parent = 0)
: QObject(parent), _prop1(false), _prop2(false), _prop3(false)
{
}
diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
index 3f5f5f2785..bd92c68f8e 100644
--- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
+++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
@@ -596,8 +596,8 @@ void tst_qqmllanguage::assignBasicTypes()
QCOMPARE(object->rectFProperty(), QRectF(1000.1, -10.9, 400, 90.99));
QCOMPARE(object->boolProperty(), true);
QCOMPARE(object->variantProperty(), QVariant("Hello World!"));
- QCOMPARE(object->vectorProperty(), QVector3D(10, 1, 2.2));
- QCOMPARE(object->vector4Property(), QVector4D(10, 1, 2.2, 2.3));
+ QCOMPARE(object->vectorProperty(), QVector3D(10, 1, 2.2f));
+ QCOMPARE(object->vector4Property(), QVector4D(10, 1, 2.2f, 2.3f));
QUrl encoded;
encoded.setEncodedUrl("main.qml?with%3cencoded%3edata", QUrl::TolerantMode);
QCOMPARE(object->urlProperty(), component.url().resolved(encoded));
@@ -2571,7 +2571,7 @@ void tst_qqmllanguage::importJs()
QCOMPARE(expected.size(), actual.size());
for (int i = 0; i < expected.size(); ++i)
{
- size_t compareLen = std::min(expected.at(i).length(), actual.at(i).length());
+ const int compareLen = qMin(expected.at(i).length(), actual.at(i).length());
QCOMPARE(expected.at(i).left(compareLen), actual.at(i).left(compareLen));
}
}
@@ -2948,13 +2948,12 @@ void tst_qqmllanguage::signalWithDefaultArg()
QCOMPARE(object->property("signalCount").toInt(), 2);
QCOMPARE(object->property("signalArg").toInt(), 15);
- const QMetaObject *metaObject = object->metaObject();
- metaObject->invokeMethod(object, "emitNoArgSignal");
+ QMetaObject::invokeMethod(object, "emitNoArgSignal");
QCOMPARE(object->property("signalCount").toInt(), 3);
QCOMPARE(object->property("signalArg").toInt(), 5);
- metaObject->invokeMethod(object, "emitArgSignal");
+ QMetaObject::invokeMethod(object, "emitArgSignal");
QCOMPARE(object->property("signalCount").toInt(), 4);
QCOMPARE(object->property("signalArg").toInt(), 22);
diff --git a/tests/auto/qml/qqmlqt/tst_qqmlqt.cpp b/tests/auto/qml/qqmlqt/tst_qqmlqt.cpp
index 22be661755..9a525df973 100644
--- a/tests/auto/qml/qqmlqt/tst_qqmlqt.cpp
+++ b/tests/auto/qml/qqmlqt/tst_qqmlqt.cpp
@@ -320,8 +320,8 @@ void tst_qqmlqt::vector2d()
QObject *object = component.create();
QVERIFY(object != 0);
- QCOMPARE(qvariant_cast<QVector2D>(object->property("test1")), QVector2D(1, 0.9));
- QCOMPARE(qvariant_cast<QVector2D>(object->property("test2")), QVector2D(102, -982.1));
+ QCOMPARE(qvariant_cast<QVector2D>(object->property("test1")), QVector2D(1, 0.9f));
+ QCOMPARE(qvariant_cast<QVector2D>(object->property("test2")), QVector2D(102, -982.1f));
QCOMPARE(qvariant_cast<QVector2D>(object->property("test3")), QVector2D());
QCOMPARE(qvariant_cast<QVector2D>(object->property("test4")), QVector2D());
@@ -340,8 +340,8 @@ void tst_qqmlqt::vector3d()
QObject *object = component.create();
QVERIFY(object != 0);
- QCOMPARE(qvariant_cast<QVector3D>(object->property("test1")), QVector3D(1, 0, 0.9));
- QCOMPARE(qvariant_cast<QVector3D>(object->property("test2")), QVector3D(102, -10, -982.1));
+ QCOMPARE(qvariant_cast<QVector3D>(object->property("test1")), QVector3D(1, 0, 0.9f));
+ QCOMPARE(qvariant_cast<QVector3D>(object->property("test2")), QVector3D(102, -10, -982.1f));
QCOMPARE(qvariant_cast<QVector3D>(object->property("test3")), QVector3D());
QCOMPARE(qvariant_cast<QVector3D>(object->property("test4")), QVector3D());
@@ -360,8 +360,8 @@ void tst_qqmlqt::vector4d()
QObject *object = component.create();
QVERIFY(object != 0);
- QCOMPARE(qvariant_cast<QVector4D>(object->property("test1")), QVector4D(1, 0, 0.9, 0.6));
- QCOMPARE(qvariant_cast<QVector4D>(object->property("test2")), QVector4D(102, -10, -982.1, 10));
+ QCOMPARE(qvariant_cast<QVector4D>(object->property("test1")), QVector4D(1, 0, 0.9f, 0.6f));
+ QCOMPARE(qvariant_cast<QVector4D>(object->property("test2")), QVector4D(102, -10, -982.1f, 10));
QCOMPARE(qvariant_cast<QVector4D>(object->property("test3")), QVector4D());
QCOMPARE(qvariant_cast<QVector4D>(object->property("test4")), QVector4D());
@@ -380,8 +380,8 @@ void tst_qqmlqt::quaternion()
QObject *object = component.create();
QVERIFY(object != 0);
- QCOMPARE(qvariant_cast<QQuaternion>(object->property("test1")), QQuaternion(2, 17, 0.9, 0.6));
- QCOMPARE(qvariant_cast<QQuaternion>(object->property("test2")), QQuaternion(102, -10, -982.1, 10));
+ QCOMPARE(qvariant_cast<QQuaternion>(object->property("test1")), QQuaternion(2, 17, 0.9f, 0.6f));
+ QCOMPARE(qvariant_cast<QQuaternion>(object->property("test2")), QQuaternion(102, -10, -982.1f, 10));
QCOMPARE(qvariant_cast<QQuaternion>(object->property("test3")), QQuaternion());
QCOMPARE(qvariant_cast<QQuaternion>(object->property("test4")), QQuaternion());