summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativebehaviors
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2010-05-24 05:40:29 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2010-05-24 05:42:25 (GMT)
commit180e2ce2cca53f2c395e8dc9213d714c396c4555 (patch)
tree2d4b88146da1c43f25f10358ed6b1d9e1fc903d8 /tests/auto/declarative/qdeclarativebehaviors
parent8cc8faa6d989b8eb7cd4e78b4a51bbdc3af6ba99 (diff)
downloadQt-180e2ce2cca53f2c395e8dc9213d714c396c4555.zip
Qt-180e2ce2cca53f2c395e8dc9213d714c396c4555.tar.gz
Qt-180e2ce2cca53f2c395e8dc9213d714c396c4555.tar.bz2
Don't crash when assigning a Behavior to a grouped property.
Task-number: QTBUG-10799 Reviewed-by: Aaron Kennedy
Diffstat (limited to 'tests/auto/declarative/qdeclarativebehaviors')
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/groupedPropertyCrash.qml10
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp10
2 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/groupedPropertyCrash.qml b/tests/auto/declarative/qdeclarativebehaviors/data/groupedPropertyCrash.qml
new file mode 100644
index 0000000..c052366
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/groupedPropertyCrash.qml
@@ -0,0 +1,10 @@
+import Qt 4.7
+
+Rectangle {
+ width: 200
+ height: 200
+ Text {
+ Behavior on anchors.verticalCenterOffset { NumberAnimation { duration: 300; } }
+ text: "Hello World"
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp b/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp
index 1dc4b53..45e5304 100644
--- a/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp
+++ b/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp
@@ -72,6 +72,7 @@ private slots:
void disabled();
void dontStart();
void startup();
+ void groupedPropertyCrash();
};
void tst_qdeclarativebehaviors::simpleBehavior()
@@ -351,6 +352,15 @@ void tst_qdeclarativebehaviors::startup()
}
}
+//QTBUG-10799
+void tst_qdeclarativebehaviors::groupedPropertyCrash()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/groupedPropertyCrash.qml"));
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect); //don't crash
+}
+
QTEST_MAIN(tst_qdeclarativebehaviors)
#include "tst_qdeclarativebehaviors.moc"