summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorWater-Team <water@pad.test.qt.nokia.com>2011-08-12 23:00:13 (GMT)
committerWater-Team <water@pad.test.qt.nokia.com>2011-08-12 23:00:13 (GMT)
commit84f5f63baa4bee04954fbdf3cf3d3126023798af (patch)
tree409acc728c57415f552f5c6c22efeea58a85d19d /tests
parent98babb1408712a14098a9a75b31c4e9603afdbc0 (diff)
parent7569e6601fb9dcf730ac20cd5c1d39307daa2810 (diff)
downloadQt-84f5f63baa4bee04954fbdf3cf3d3126023798af.zip
Qt-84f5f63baa4bee04954fbdf3cf3d3126023798af.tar.gz
Qt-84f5f63baa4bee04954fbdf3cf3d3126023798af.tar.bz2
Merge branch '4.8-upstream' into master-water
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/transitionAssignmentBug.qml12
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp13
-rw-r--r--tests/auto/declarative/qdeclarativebinding/data/deletedObject.qml24
-rw-r--r--tests/auto/declarative/qdeclarativebinding/tst_qdeclarativebinding.cpp17
4 files changed, 66 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/transitionAssignmentBug.qml b/tests/auto/declarative/qdeclarativeanimations/data/transitionAssignmentBug.qml
new file mode 100644
index 0000000..99b9ac5
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimations/data/transitionAssignmentBug.qml
@@ -0,0 +1,12 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400
+ height: 400
+
+ property bool nullObject
+ Component.onCompleted: nullObject = transitions.length > 0 && transitions[0] === null
+
+ property list<Transition> myTransitions: [Transition {}, Transition {}]
+ transitions: myTransitions
+}
diff --git a/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp b/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp
index 00db2d4..5d90597 100644
--- a/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp
+++ b/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp
@@ -88,6 +88,7 @@ private slots:
void registrationBug();
void doubleRegistrationBug();
void alwaysRunToEndRestartBug();
+ void transitionAssignmentBug();
};
#define QTIMED_COMPARE(lhs, rhs) do { \
@@ -844,6 +845,18 @@ void tst_qdeclarativeanimations::alwaysRunToEndRestartBug()
QCOMPARE(static_cast<QDeclarativeAbstractAnimation*>(&animation)->qtAnimation()->state(), QAbstractAnimation::Stopped);
}
+//QTBUG-20227
+void tst_qdeclarativeanimations::transitionAssignmentBug()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c(&engine, SRCDIR "/data/transitionAssignmentBug.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect != 0);
+
+ QCOMPARE(rect->property("nullObject").toBool(), false);
+}
+
QTEST_MAIN(tst_qdeclarativeanimations)
#include "tst_qdeclarativeanimations.moc"
diff --git a/tests/auto/declarative/qdeclarativebinding/data/deletedObject.qml b/tests/auto/declarative/qdeclarativebinding/data/deletedObject.qml
new file mode 100644
index 0000000..ba4c9f6
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativebinding/data/deletedObject.qml
@@ -0,0 +1,24 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: wrapper
+ width: 400
+ height: 400
+
+ property bool activateBinding: false
+
+ Binding {
+ id: binding
+ target: Qt.createQmlObject('import QtQuick 1.0; Item { property real value: 10 }', wrapper)
+ property: "value"
+ when: activateBinding
+ value: x + y
+ }
+
+ Component.onCompleted: binding.target.destroy();
+
+// MouseArea {
+// anchors.fill: parent
+// onClicked: activateBinding = true;
+// }
+}
diff --git a/tests/auto/declarative/qdeclarativebinding/tst_qdeclarativebinding.cpp b/tests/auto/declarative/qdeclarativebinding/tst_qdeclarativebinding.cpp
index 6305cd3..ca394b0 100644
--- a/tests/auto/declarative/qdeclarativebinding/tst_qdeclarativebinding.cpp
+++ b/tests/auto/declarative/qdeclarativebinding/tst_qdeclarativebinding.cpp
@@ -60,6 +60,7 @@ public:
private slots:
void binding();
void whenAfterValue();
+ void deletedObject();
private:
QDeclarativeEngine engine;
@@ -113,6 +114,22 @@ void tst_qdeclarativebinding::whenAfterValue()
delete rect;
}
+//QTBUG-20692
+void tst_qdeclarativebinding::deletedObject()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/deletedObject.qml"));
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect != 0);
+
+ QApplication::sendPostedEvents(0, QEvent::DeferredDelete);
+
+ //don't crash
+ rect->setProperty("activateBinding", true);
+
+ delete rect;
+}
+
QTEST_MAIN(tst_qdeclarativebinding)
#include "tst_qdeclarativebinding.moc"