diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2010-05-24 15:40:29 +1000 |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2010-05-24 15:42:25 +1000 |
commit | 180e2ce2cca53f2c395e8dc9213d714c396c4555 (patch) | |
tree | 2d4b88146da1c43f25f10358ed6b1d9e1fc903d8 /tests | |
parent | 8cc8faa6d989b8eb7cd4e78b4a51bbdc3af6ba99 (diff) | |
download | qt4-tools-180e2ce2cca53f2c395e8dc9213d714c396c4555.tar.gz |
Don't crash when assigning a Behavior to a grouped property.
Task-number: QTBUG-10799
Reviewed-by: Aaron Kennedy
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/declarative/qdeclarativebehaviors/data/groupedPropertyCrash.qml | 10 | ||||
-rw-r--r-- | tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp | 10 |
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 0000000000..c052366717 --- /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 1dc4b533d8..45e53042b6 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" |