diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2016-12-16 15:26:33 +0100 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2016-12-17 09:43:22 +0000 |
commit | 3ffa8ab293dcca9f76adfc5e314fefa091e58a23 (patch) | |
tree | 7652dceb3773d48a3d3e1561c471e571d1217ecb /tests | |
parent | b2de056f6f04cea57dc44f37b41d07e94c03e183 (diff) |
tst_pane: 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: I1c032460f64c1ea09c0b4eebc0b29deec0a43e45
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/controls/data/tst_pane.qml | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/tests/auto/controls/data/tst_pane.qml b/tests/auto/controls/data/tst_pane.qml index 2f5ddef3..a5016ab8 100644 --- a/tests/auto/controls/data/tst_pane.qml +++ b/tests/auto/controls/data/tst_pane.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. @@ -103,54 +103,46 @@ TestCase { } function test_empty() { - var control = pane.createObject(testCase) + var control = createTemporaryObject(pane, testCase) verify(control) verify(control.contentItem) compare(control.contentWidth, 0) compare(control.contentHeight, 0) - - control.destroy() } function test_oneChild() { - var control = oneChildPane.createObject(testCase) + var control = createTemporaryObject(oneChildPane, testCase) verify(control) compare(control.contentWidth, 100) compare(control.contentHeight, 30) verify(control.implicitWidth > 100) verify(control.implicitHeight > 30) - - control.destroy() } function test_twoChildren() { - var control = twoChildrenPane.createObject(testCase) + var control = createTemporaryObject(twoChildrenPane, testCase) verify(control) compare(control.contentWidth, 0) compare(control.contentHeight, 0) verify(control.implicitWidth > 0) verify(control.implicitHeight > 0) - - control.destroy() } function test_contentItem() { - var control = contentPane.createObject(testCase) + var control = createTemporaryObject(contentPane, testCase) verify(control) compare(control.contentWidth, 100) compare(control.contentHeight, 30) verify(control.implicitWidth > 100) verify(control.implicitHeight > 30) - - control.destroy() } function test_press() { - var control = pressPane.createObject(testCase) + var control = createTemporaryObject(pressPane, testCase) verify(control) compare(control.pressCount, 0) @@ -160,7 +152,5 @@ TestCase { control.children[0].enabled = false mouseClick(control) compare(control.pressCount, 1) - - control.destroy() } } |