diff options
author | Friedemann Kleint <Friedemann.Kleint@digia.com> | 2012-12-19 16:18:52 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-12-20 15:44:48 +0100 |
commit | 920b949e5185258baabfb3f738b660b3c0f002e3 (patch) | |
tree | 702fa5cb06854a1c213e896fd38edbcf912d4731 /tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp | |
parent | ad821a63bf4075f2b18ec9eaa6d58f8fd721269a (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/qqmllanguage/tst_qqmllanguage.cpp')
-rw-r--r-- | tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
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); |