summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativestates
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2010-04-06 23:54:22 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2010-04-06 23:55:52 (GMT)
commit71a328397720af7229fd6ee48acaa19f7339a8de (patch)
treeef2e6b2f14d871b7655ba2e8fb99ba0a9486beaa /tests/auto/declarative/qdeclarativestates
parent3a632cb5f1c1da5c2e72ce167e35a42778867829 (diff)
downloadQt-71a328397720af7229fd6ee48acaa19f7339a8de.zip
Qt-71a328397720af7229fd6ee48acaa19f7339a8de.tar.gz
Qt-71a328397720af7229fd6ee48acaa19f7339a8de.tar.bz2
Don't crash if a target isn't specified for AnchorChanges.
Diffstat (limited to 'tests/auto/declarative/qdeclarativestates')
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/anchorChangesCrash.qml14
-rw-r--r--tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp15
2 files changed, 29 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativestates/data/anchorChangesCrash.qml b/tests/auto/declarative/qdeclarativestates/data/anchorChangesCrash.qml
new file mode 100644
index 0000000..861ef8f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/anchorChangesCrash.qml
@@ -0,0 +1,14 @@
+import Qt 4.7
+
+Rectangle {
+ id: container
+ width: 400
+ height: 400
+
+ states: State {
+ name: "reanchored"
+ AnchorChanges {
+ anchors.top: container.top
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp
index 2ab21a4..e7c595a 100644
--- a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp
+++ b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp
@@ -94,6 +94,7 @@ private slots:
void anchorChanges3();
void anchorChanges4();
void anchorChanges5();
+ void anchorChangesCrash();
void script();
void restoreEntryValues();
void explicitChanges();
@@ -716,6 +717,20 @@ void tst_qdeclarativestates::anchorChanges5()
delete rect;
}
+//QTBUG-9609
+void tst_qdeclarativestates::anchorChangesCrash()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/anchorChangesCrash.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+
+ rect->setState("reanchored");
+
+ delete rect;
+}
+
void tst_qdeclarativestates::script()
{
QDeclarativeEngine engine;