diff options
4 files changed, 19 insertions, 12 deletions
diff --git a/tests/auto/declarative/animations/data/badproperty1.qml b/tests/auto/declarative/animations/data/badproperty1.qml index 6f31fe8..fda322c 100644 --- a/tests/auto/declarative/animations/data/badproperty1.qml +++ b/tests/auto/declarative/animations/data/badproperty1.qml @@ -9,10 +9,6 @@ Rectangle { color: "red" width: 50; height: 50 x: 100; y: 100 - MouseRegion { - anchors.fill: parent - onClicked: if (Wrapper.state == "state1") Wrapper.state = ""; else Wrapper.state = "state1"; - } } states: State { name: "state1" @@ -21,4 +17,5 @@ Rectangle { transitions: Transition { ColorAnimation { target: MyRect; to: "red"; property: "border.colr"; duration: 1000 } } + Component.onCompleted: if (Wrapper.state == "state1") Wrapper.state = ""; else Wrapper.state = "state1"; } diff --git a/tests/auto/declarative/animations/data/badproperty2.qml b/tests/auto/declarative/animations/data/badproperty2.qml index c7d1673..0e8366a 100644 --- a/tests/auto/declarative/animations/data/badproperty2.qml +++ b/tests/auto/declarative/animations/data/badproperty2.qml @@ -9,10 +9,6 @@ Rectangle { color: "red" width: 50; height: 50 x: 100; y: 100 - MouseRegion { - anchors.fill: parent - onClicked: if (Wrapper.state == "state1") Wrapper.state = ""; else Wrapper.state = "state1"; - } } states: State { name: "state1" @@ -21,4 +17,5 @@ Rectangle { transitions: Transition { ColorAnimation { target: MyRect; to: "red"; property: "border"; duration: 1000 } } + Component.onCompleted: if (Wrapper.state == "state1") Wrapper.state = ""; else Wrapper.state = "state1"; } diff --git a/tests/auto/declarative/animations/tst_animations.cpp b/tests/auto/declarative/animations/tst_animations.cpp index d9a81c4..35eae73 100644 --- a/tests/auto/declarative/animations/tst_animations.cpp +++ b/tests/auto/declarative/animations/tst_animations.cpp @@ -151,6 +151,15 @@ void tst_animations::simpleColor() animation.setCurrentTime(125); QVERIFY(animation.currentTime() == 125); QCOMPARE(rect.color(), QColor::fromRgbF(0.498039, 0, 0.498039, 1)); + + rect.setColor(QColor("green")); + animation.setFrom(QColor("blue")); + QVERIFY(animation.from() == QColor("blue")); + animation.restart(); + QCOMPARE(rect.color(), QColor("blue")); + QVERIFY(animation.isRunning()); + animation.setCurrentTime(125); + QCOMPARE(rect.color(), QColor::fromRgbF(0.498039, 0, 0.498039, 1)); } void tst_animations::alwaysRunToEnd() @@ -297,12 +306,16 @@ void tst_animations::badProperties() QmlEngine engine; QmlComponent c1(&engine, QUrl("file://" SRCDIR "/data/badproperty1.qml")); - QTest::ignoreMessage(QtWarningMsg, "QML ColorAnimation (file://" SRCDIR "/data/badproperty1.qml:22:9) Cannot animate non-existant property \"border.colr\""); + QByteArray message = "QML ColorAnimation (file://" SRCDIR "/data/badproperty1.qml:18:9) Cannot animate non-existant property \"border.colr\""; + QTest::ignoreMessage(QtWarningMsg, message); + QTest::ignoreMessage(QtWarningMsg, message); // why twice? QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(c1.create()); QVERIFY(rect); QmlComponent c2(&engine, QUrl("file://" SRCDIR "/data/badproperty2.qml")); - QTest::ignoreMessage(QtWarningMsg, "QML ColorAnimation (file://" SRCDIR "/data/badproperty2.qml:22:9) Cannot animate read-only property \"border\""); + message = "QML ColorAnimation (file://" SRCDIR "/data/badproperty2.qml:18:9) Cannot animate read-only property \"border\""; + QTest::ignoreMessage(QtWarningMsg, message); + QTest::ignoreMessage(QtWarningMsg, message); // why twice? rect = qobject_cast<QmlGraphicsRectangle*>(c2.create()); QVERIFY(rect); diff --git a/tests/auto/declarative/qmlgraphicsflipable/tst_qmlgraphicsflipable.cpp b/tests/auto/declarative/qmlgraphicsflipable/tst_qmlgraphicsflipable.cpp index f1a3ec8..d4177a7 100644 --- a/tests/auto/declarative/qmlgraphicsflipable/tst_qmlgraphicsflipable.cpp +++ b/tests/auto/declarative/qmlgraphicsflipable/tst_qmlgraphicsflipable.cpp @@ -98,11 +98,11 @@ void tst_qmlgraphicsflipable::setFrontAndBack() QVERIFY(obj->front() != 0); QVERIFY(obj->back() != 0); - QString message = "QML " + QString(obj->metaObject()->className()) + " (" + c.url().toString() + ":3:1) front is a write-once property"; + QString message = "QML Flipable (" + c.url().toString() + ":3:1) front is a write-once property"; QTest::ignoreMessage(QtWarningMsg, qPrintable(message)); obj->setFront(new QmlGraphicsRectangle()); - message = "QML " + QString(obj->metaObject()->className()) + " (" + c.url().toString() + ":3:1) back is a write-once property"; + message = "QML Flipable (" + c.url().toString() + ":3:1) back is a write-once property"; QTest::ignoreMessage(QtWarningMsg, qPrintable(message)); obj->setBack(new QmlGraphicsRectangle()); delete obj; |