From 6f3165441a96cd0fc376d2bdc661f65802658791 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Thu, 14 Jan 2010 17:22:26 +1000 Subject: message changed --- .../auto/declarative/qmlgraphicsflipable/tst_qmlgraphicsflipable.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; -- cgit v0.12 From de0a8ecadc072c0c3d7dd28af9ca544e48f3caed Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Thu, 14 Jan 2010 17:40:30 +1000 Subject: fix test (required clicking!) --- tests/auto/declarative/animations/data/badproperty1.qml | 5 +---- tests/auto/declarative/animations/data/badproperty2.qml | 5 +---- tests/auto/declarative/animations/tst_animations.cpp | 8 ++++++-- 3 files changed, 8 insertions(+), 10 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..588234c 100644 --- a/tests/auto/declarative/animations/tst_animations.cpp +++ b/tests/auto/declarative/animations/tst_animations.cpp @@ -297,12 +297,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(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(c2.create()); QVERIFY(rect); -- cgit v0.12 From 56779ad993c9ea72689921f1b7b0942721fe5648 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Thu, 14 Jan 2010 17:46:44 +1000 Subject: Test color "from" property. --- tests/auto/declarative/animations/tst_animations.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/auto/declarative/animations/tst_animations.cpp b/tests/auto/declarative/animations/tst_animations.cpp index 588234c..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() -- cgit v0.12