aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2016-12-20 11:49:44 +0100
committerMitch Curtis <mitch.curtis@qt.io>2016-12-20 11:59:03 +0000
commit5ed8540c94217e5a685780a6528af9e2d9057219 (patch)
tree61a8f119f7d8edd31bfcf62ba0dd11b8734348dd /tests
parentf8e0ca8c5fcb8e1d9f94ca4fecef78fe8c98e1dc (diff)
tst_tabbutton: 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: I6b1b8ea3872d5a4fc00f9786e29d3b7fa433bd11 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/controls/data/tst_tabbutton.qml9
1 files changed, 3 insertions, 6 deletions
diff --git a/tests/auto/controls/data/tst_tabbutton.qml b/tests/auto/controls/data/tst_tabbutton.qml
index 77d22a48..a1fe479f 100644
--- a/tests/auto/controls/data/tst_tabbutton.qml
+++ b/tests/auto/controls/data/tst_tabbutton.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.
@@ -66,7 +66,7 @@ TestCase {
}
function test_autoExclusive() {
- var container = repeater.createObject(testCase)
+ var container = createTemporaryObject(repeater, testCase)
for (var i = 0; i < 3; ++i) {
container.children[i].checked = true
@@ -78,14 +78,11 @@ TestCase {
compare(container.children[j].checked, false)
}
}
-
- container.destroy()
}
function test_baseline() {
- var control = tabButton.createObject(testCase)
+ var control = createTemporaryObject(tabButton, testCase)
verify(control)
compare(control.baselineOffset, control.contentItem.y + control.contentItem.baselineOffset)
- control.destroy()
}
}