diff options
author | Robin Burchell <robin.burchell@crimson.no> | 2017-04-21 12:29:22 +0200 |
---|---|---|
committer | Robin Burchell <robin.burchell@crimson.no> | 2017-04-21 18:34:00 +0000 |
commit | 8694b9002f011d0c93b6e25fae381508c4ce54b0 (patch) | |
tree | 6d18bbceeb98f5fa575bce395c7f82472a8770d0 /tests/auto/qml/qqmlengine/data | |
parent | 4397eca4e35b7818f5b251722bf07f53692c9379 (diff) |
Add an autotest for GC crashes on some platforms
Related to QTBUG-59977, where crashes were seen on some platforms.
Try to prevent this from creeping out and inconveniencing other modules again.
Task-number: QTBUG-59977
Change-Id: I89730c7882e4d87e6049f087724988a7aa52d5a5
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tests/auto/qml/qqmlengine/data')
-rw-r--r-- | tests/auto/qml/qqmlengine/data/testGCCorruption.qml | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlengine/data/testGCCorruption.qml b/tests/auto/qml/qqmlengine/data/testGCCorruption.qml new file mode 100644 index 0000000000..8728b9b915 --- /dev/null +++ b/tests/auto/qml/qqmlengine/data/testGCCorruption.qml @@ -0,0 +1,29 @@ +import QtQml 2.0 + +QtObject { + id: root + property int count: 10000; + property var items: []; + + property Component component: Component { + id: component; + QtObject { + } + } + + property int iterations: 0 + Component.onCompleted: { + for (var iterations = 0; iterations < 5; ++iterations) { + for (var i=0; i<items.length; ++i) { + items[i].destroy(); + } + + for (var i=0; i<root.count; ++i) { + var object = component.createObject(); + items[i] = object + } + } + + // if we crash, then something bad has happened. :) + } +} |