diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2016-12-16 15:09:45 +0100 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2016-12-17 09:43:03 +0000 |
commit | 05c7c180c78c7ce5700da90dc78ceaa1dd03a186 (patch) | |
tree | 37281980c162a46e2d5fcca8ee9de67598d46848 /tests/auto | |
parent | e99d9190ca945435ddb4dcb3eeab7fd710089370 (diff) |
tst_frame: 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: Idb91be7036984e752134f85858eae2cd90cec462
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/controls/data/tst_frame.qml | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/tests/auto/controls/data/tst_frame.qml b/tests/auto/controls/data/tst_frame.qml index c64b0048..f20df743 100644 --- a/tests/auto/controls/data/tst_frame.qml +++ b/tests/auto/controls/data/tst_frame.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 = frame.createObject(testCase) + var control = createTemporaryObject(frame, testCase) verify(control) verify(control.contentItem) compare(control.contentWidth, 0) compare(control.contentHeight, 0) - - control.destroy() } function test_oneChild() { - var control = oneChildFrame.createObject(testCase) + var control = createTemporaryObject(oneChildFrame, 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 = twoChildrenFrame.createObject(testCase) + var control = createTemporaryObject(twoChildrenFrame, 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 = contentFrame.createObject(testCase) + var control = createTemporaryObject(contentFrame, testCase) verify(control) compare(control.contentWidth, 100) compare(control.contentHeight, 30) verify(control.implicitWidth > 100) verify(control.implicitHeight > 30) - - control.destroy() } } |