diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2016-12-20 12:32:06 +0100 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2016-12-20 11:58:51 +0000 |
commit | 3863ee78e609025cb336daeabcccd9ab563e86bf (patch) | |
tree | ceb792f065e2045554638808814524d8ccd8fadc /tests/auto/controls/data/tst_toolbar.qml | |
parent | 80a40af6febb6d00b0c30b35e14345c8584a2659 (diff) |
tst_toolbar: 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: Id41f6c68be54d16fab3cf83a9bbb462700bc8156
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'tests/auto/controls/data/tst_toolbar.qml')
-rw-r--r-- | tests/auto/controls/data/tst_toolbar.qml | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/tests/auto/controls/data/tst_toolbar.qml b/tests/auto/controls/data/tst_toolbar.qml index cc64383e..8e8c11c0 100644 --- a/tests/auto/controls/data/tst_toolbar.qml +++ b/tests/auto/controls/data/tst_toolbar.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 = toolBar.createObject(testCase) + var control = createTemporaryObject(toolBar, testCase) verify(control) verify(control.contentItem) compare(control.contentWidth, 0) compare(control.contentHeight, 0) - - control.destroy() } function test_oneChild() { - var control = oneChildBar.createObject(testCase) + var control = createTemporaryObject(oneChildBar, 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 = twoChildrenBar.createObject(testCase) + var control = createTemporaryObject(twoChildrenBar, 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 = contentBar.createObject(testCase) + var control = createTemporaryObject(contentBar, testCase) verify(control) compare(control.contentWidth, 100) compare(control.contentHeight, 30) verify(control.implicitWidth >= 100) verify(control.implicitHeight >= 30) - - control.destroy() } } |