diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2016-12-16 15:16:26 +0100 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2016-12-17 09:43:14 +0000 |
commit | caa2abc72ef55f901282ee36dd750b4ac3da2d27 (patch) | |
tree | 07dbf9fafd36d9712cdc001aed1d1589b599e7ca /tests | |
parent | a9c661da8d0b430e169899d963a5d224a4f05852 (diff) |
tst_menuitem: 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: I5da1e875099cd134a69ac5f6d2593d930e0702b5
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/controls/data/tst_menuitem.qml | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/tests/auto/controls/data/tst_menuitem.qml b/tests/auto/controls/data/tst_menuitem.qml index b5e08866..533ad242 100644 --- a/tests/auto/controls/data/tst_menuitem.qml +++ b/tests/auto/controls/data/tst_menuitem.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. @@ -56,14 +56,13 @@ TestCase { } function test_baseline() { - var control = menuItem.createObject(testCase) + var control = createTemporaryObject(menuItem, testCase) verify(control) compare(control.baselineOffset, control.contentItem.y + control.contentItem.baselineOffset) - control.destroy() } function test_checkable() { - var control = menuItem.createObject(testCase) + var control = createTemporaryObject(menuItem, testCase) verify(control) verify(control.hasOwnProperty("checkable")) verify(!control.checkable) @@ -77,18 +76,14 @@ TestCase { mouseClick(control) verify(!control.checked) - - control.destroy() } function test_highlighted() { - var control = menuItem.createObject(testCase) + var control = createTemporaryObject(menuItem, testCase) verify(control) verify(!control.highlighted) control.highlighted = true verify(control.highlighted) - - control.destroy() } } |