From e70ee6ba3fac19fcfe402825e54e5244e3ca6eb7 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Fri, 16 Dec 2016 15:13:24 +0100 Subject: tst_itemdelegate: 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: Ia0ae26235b8e466b80dd674a3d1f530795ade165 Reviewed-by: J-P Nurmi --- tests/auto/controls/data/tst_itemdelegate.qml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/controls/data/tst_itemdelegate.qml b/tests/auto/controls/data/tst_itemdelegate.qml index 8eafad57..d5e2b31f 100644 --- a/tests/auto/controls/data/tst_itemdelegate.qml +++ b/tests/auto/controls/data/tst_itemdelegate.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,20 +56,17 @@ TestCase { } function test_baseline() { - var control = itemDelegate.createObject(testCase) + var control = createTemporaryObject(itemDelegate, testCase) verify(control) compare(control.baselineOffset, control.contentItem.y + control.contentItem.baselineOffset) - control.destroy() } function test_highlighted() { - var control = itemDelegate.createObject(testCase) + var control = createTemporaryObject(itemDelegate, testCase) verify(control) verify(!control.highlighted) control.highlighted = true verify(control.highlighted) - - control.destroy() } } -- cgit v1.2.3