summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative/animations/data/badproperty1.qml2
-rw-r--r--tests/auto/declarative/animations/data/badproperty2.qml24
-rw-r--r--tests/auto/declarative/animations/tst_animations.cpp12
3 files changed, 34 insertions, 4 deletions
diff --git a/tests/auto/declarative/animations/data/badproperty1.qml b/tests/auto/declarative/animations/data/badproperty1.qml
index df1a98d..6f31fe8 100644
--- a/tests/auto/declarative/animations/data/badproperty1.qml
+++ b/tests/auto/declarative/animations/data/badproperty1.qml
@@ -19,6 +19,6 @@ Rectangle {
PropertyChanges { target: MyRect; border.color: "blue" }
}
transitions: Transition {
- ColorAnimation { target: MyRect; to: "red"; property: "pen.colr"; duration: 1000 }
+ ColorAnimation { target: MyRect; to: "red"; property: "border.colr"; duration: 1000 }
}
}
diff --git a/tests/auto/declarative/animations/data/badproperty2.qml b/tests/auto/declarative/animations/data/badproperty2.qml
new file mode 100644
index 0000000..c7d1673
--- /dev/null
+++ b/tests/auto/declarative/animations/data/badproperty2.qml
@@ -0,0 +1,24 @@
+import Qt 4.6
+
+Rectangle {
+ id: Wrapper
+ width: 240
+ height: 320
+ Rectangle {
+ id: MyRect
+ 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"
+ PropertyChanges { target: MyRect; border.color: "blue" }
+ }
+ transitions: Transition {
+ ColorAnimation { target: MyRect; to: "red"; property: "border"; duration: 1000 }
+ }
+}
diff --git a/tests/auto/declarative/animations/tst_animations.cpp b/tests/auto/declarative/animations/tst_animations.cpp
index 2506337..73bed79 100644
--- a/tests/auto/declarative/animations/tst_animations.cpp
+++ b/tests/auto/declarative/animations/tst_animations.cpp
@@ -295,9 +295,15 @@ void tst_animations::badProperties()
//make sure we get a runtime error
{
QmlEngine engine;
- QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/badproperty1.qml"));
- QTest::ignoreMessage(QtWarningMsg, "QML QmlColorAnimation (file://" SRCDIR "/data/badproperty1.qml:22:9) Cannot animate non-existant property \"pen.colr\"");
- QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(c.create());
+
+ QmlComponent c1(&engine, QUrl("file://" SRCDIR "/data/badproperty1.qml"));
+ QTest::ignoreMessage(QtWarningMsg, "QML QmlColorAnimation (file://" SRCDIR "/data/badproperty1.qml:22:9) Cannot animate non-existant property \"border.colr\"");
+ QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(c1.create());
+ QVERIFY(rect);
+
+ QmlComponent c2(&engine, QUrl("file://" SRCDIR "/data/badproperty2.qml"));
+ QTest::ignoreMessage(QtWarningMsg, "QML QmlColorAnimation (file://" SRCDIR "/data/badproperty2.qml:22:9) Cannot animate read-only property \"border\"");
+ rect = qobject_cast<QmlGraphicsRectangle*>(c2.create());
QVERIFY(rect);
//### should we warn here are well?