From b2de056f6f04cea57dc44f37b41d07e94c03e183 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Fri, 16 Dec 2016 15:21:22 +0100 Subject: tst_pageindicator: 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: Ife9d9680dcce6685c43e7ee52cd4782bc6961a3f Reviewed-by: J-P Nurmi --- tests/auto/controls/data/tst_pageindicator.qml | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'tests') diff --git a/tests/auto/controls/data/tst_pageindicator.qml b/tests/auto/controls/data/tst_pageindicator.qml index a39265c3..e68e8bb7 100644 --- a/tests/auto/controls/data/tst_pageindicator.qml +++ b/tests/auto/controls/data/tst_pageindicator.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,29 +56,25 @@ TestCase { } function test_count() { - var control = pageIndicator.createObject(testCase) + var control = createTemporaryObject(pageIndicator, testCase) verify(control) compare(control.count, 0) control.count = 3 compare(control.count, 3) - - control.destroy() } function test_currentIndex() { - var control = pageIndicator.createObject(testCase) + var control = createTemporaryObject(pageIndicator, testCase) verify(control) compare(control.currentIndex, 0) control.currentIndex = 5 compare(control.currentIndex, 5) - - control.destroy() } function test_interactive() { - var control = pageIndicator.createObject(testCase, {count: 5}) + var control = createTemporaryObject(pageIndicator, testCase, {count: 5}) verify(control) verify(!control.interactive) @@ -110,7 +106,5 @@ TestCase { } } } - - control.destroy() } } -- cgit v1.2.3