diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2016-12-15 16:22:00 +0100 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2016-12-16 13:26:00 +0000 |
commit | 71061d0288ceea6af5a0136531ba2a1a223d0819 (patch) | |
tree | 229be924458bf62143e8fb70ec878641bed82302 /tests/auto/controls/data/tst_abstractbutton.qml | |
parent | b712a656d91f8c3b0ac63a9567f735b44822be6c (diff) |
tst_abstractbutton: use TestCase's new createTemporaryObject functions
This ensures that the appropriate objects are destroyed at the end of
each test function.
Change-Id: Ib63719e134eb207cfc712b3a38e015cf853b6ae6
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'tests/auto/controls/data/tst_abstractbutton.qml')
-rw-r--r-- | tests/auto/controls/data/tst_abstractbutton.qml | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/tests/auto/controls/data/tst_abstractbutton.qml b/tests/auto/controls/data/tst_abstractbutton.qml index 83ca7980..17e12e91 100644 --- a/tests/auto/controls/data/tst_abstractbutton.qml +++ b/tests/auto/controls/data/tst_abstractbutton.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. @@ -66,7 +66,7 @@ TestCase { } function test_text() { - var control = button.createObject(testCase); + var control = createTemporaryObject(button, testCase); verify(control); compare(control.text, ""); @@ -74,21 +74,18 @@ TestCase { compare(control.text, "Button"); control.text = ""; compare(control.text, ""); - - control.destroy(); } function test_baseline() { - var control = button.createObject(testCase, {padding: 6}) + var control = createTemporaryObject(button, testCase, {padding: 6}) verify(control) compare(control.baselineOffset, 0) control.contentItem = item.createObject(control, {baselineOffset: 12}) compare(control.baselineOffset, 18) - control.destroy() } function test_implicitSize() { - var control = button.createObject(testCase) + var control = createTemporaryObject(button, testCase) verify(control) compare(control.implicitWidth, 0) @@ -105,12 +102,10 @@ TestCase { control.padding = 100 compare(control.implicitWidth, 210) compare(control.implicitHeight, 220) - - control.destroy() } function test_pressAndHold() { - var control = button.createObject(testCase, {checkable: true}) + var control = createTemporaryObject(button, testCase, {checkable: true}) verify(control) var pressAndHoldSpy = signalSpy.createObject(control, {target: control, signalName: "pressAndHold"}) @@ -122,7 +117,5 @@ TestCase { mouseRelease(control) compare(control.checked, false) - - control.destroy() } } |