From 5ed8540c94217e5a685780a6528af9e2d9057219 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Tue, 20 Dec 2016 11:49:44 +0100 Subject: tst_tabbutton: 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: I6b1b8ea3872d5a4fc00f9786e29d3b7fa433bd11 Reviewed-by: J-P Nurmi --- tests/auto/controls/data/tst_tabbutton.qml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'tests') diff --git a/tests/auto/controls/data/tst_tabbutton.qml b/tests/auto/controls/data/tst_tabbutton.qml index 77d22a48..a1fe479f 100644 --- a/tests/auto/controls/data/tst_tabbutton.qml +++ b/tests/auto/controls/data/tst_tabbutton.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_autoExclusive() { - var container = repeater.createObject(testCase) + var container = createTemporaryObject(repeater, testCase) for (var i = 0; i < 3; ++i) { container.children[i].checked = true @@ -78,14 +78,11 @@ TestCase { compare(container.children[j].checked, false) } } - - container.destroy() } function test_baseline() { - var control = tabButton.createObject(testCase) + var control = createTemporaryObject(tabButton, testCase) verify(control) compare(control.baselineOffset, control.contentItem.y + control.contentItem.baselineOffset) - control.destroy() } } -- cgit v1.2.3