diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2016-12-16 15:11:50 +0100 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2016-12-17 09:43:07 +0000 |
commit | 89ea8f240364ed2a6d4fdfef5e0842155db8f6a3 (patch) | |
tree | 74da6498658613a31fea0c16823844ac83f8eb6c /tests/auto/controls/data/tst_groupbox.qml | |
parent | 05c7c180c78c7ce5700da90dc78ceaa1dd03a186 (diff) |
tst_groupbox: 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: I1a90f1132c50abf2f2e6c978aa9248fbb385a71b
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'tests/auto/controls/data/tst_groupbox.qml')
-rw-r--r-- | tests/auto/controls/data/tst_groupbox.qml | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/tests/auto/controls/data/tst_groupbox.qml b/tests/auto/controls/data/tst_groupbox.qml index 41f1c780..c29f3602 100644 --- a/tests/auto/controls/data/tst_groupbox.qml +++ b/tests/auto/controls/data/tst_groupbox.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. @@ -90,49 +90,41 @@ TestCase { } function test_empty() { - var control = groupBox.createObject(testCase) + var control = createTemporaryObject(groupBox, testCase) verify(control) verify(control.contentItem) compare(control.contentWidth, 0) compare(control.contentHeight, 0) - - control.destroy() } function test_oneChild() { - var control = oneChildBox.createObject(testCase) + var control = createTemporaryObject(oneChildBox, 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 = twoChildrenBox.createObject(testCase) + var control = createTemporaryObject(twoChildrenBox, 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 = contentBox.createObject(testCase) + var control = createTemporaryObject(contentBox, testCase) verify(control) compare(control.contentWidth, 100) compare(control.contentHeight, 30) verify(control.implicitWidth > 100) verify(control.implicitHeight > 30) - - control.destroy() } } |