aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2016-12-16 15:07:46 +0100
committerMitch Curtis <mitch.curtis@qt.io>2016-12-19 14:19:16 +0000
commit324b7413b4d7fc7ba955583c4dd0834c96f2af75 (patch)
tree8eb46c7e50a9f1c98ac3b7af4d22a0178a691aa6 /tests
parentdccca79b25b0556a8b432496559510d061715225 (diff)
tst_drawer: use TestCase's new createTemporaryObject functions
This ensures that the appropriate objects are destroyed at the end of each test function, even if the test fails. Change-Id: I5ef93db270196b8d2c367cdf74f82391331757c7 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/controls/data/tst_drawer.qml9
1 files changed, 3 insertions, 6 deletions
diff --git a/tests/auto/controls/data/tst_drawer.qml b/tests/auto/controls/data/tst_drawer.qml
index 2e1f32dc..e10182ff 100644
--- a/tests/auto/controls/data/tst_drawer.qml
+++ b/tests/auto/controls/data/tst_drawer.qml
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2016 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -56,12 +56,11 @@ TestCase {
}
function test_defaults() {
- var control = drawer.createObject(testCase)
+ var control = createTemporaryObject(drawer, testCase)
compare(control.edge, Qt.LeftEdge)
compare(control.position, 0.0)
compare(control.dragMargin, Qt.styleHints.startDragDistance)
compare(control.parent, ApplicationWindow.overlay)
- control.destroy()
}
Component {
@@ -79,7 +78,7 @@ TestCase {
function test_swipeVelocity() {
skip("QTBUG-52003");
- var control = rectDrawer.createObject(testCase)
+ var control = createTemporaryObject(rectDrawer, testCase)
verify(control.contentItem)
compare(control.edge, Qt.LeftEdge)
compare(control.position, 0.0)
@@ -95,7 +94,5 @@ TestCase {
tryCompare(control, "position", distance / control.contentItem.width)
mouseRelease(control, distance, 0, Qt.LeftButton)
tryCompare(control, "position", 1.0)
-
- control.destroy()
}
}