From 1d88f117f0ee0408d8552c96e8fb41ddee37e3c9 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Fri, 16 Dec 2016 16:03:52 +0100 Subject: tst_radiodelegate: 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: Ie553a2603236585f970f8513f1697de2f5d41ba1 Reviewed-by: J-P Nurmi --- tests/auto/controls/data/tst_radiodelegate.qml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'tests') diff --git a/tests/auto/controls/data/tst_radiodelegate.qml b/tests/auto/controls/data/tst_radiodelegate.qml index 66b47b3a..96229bad 100644 --- a/tests/auto/controls/data/tst_radiodelegate.qml +++ b/tests/auto/controls/data/tst_radiodelegate.qml @@ -58,14 +58,13 @@ TestCase { // TODO: data-fy tst_radiobutton (rename to tst_radio?) so we don't duplicate its tests here? function test_defaults() { - var control = radioDelegate.createObject(testCase); + var control = createTemporaryObject(radioDelegate, testCase); verify(control); verify(!control.checked); - control.destroy(); } function test_checked() { - var control = radioDelegate.createObject(testCase); + var control = createTemporaryObject(radioDelegate, testCase); verify(control); mouseClick(control); @@ -73,14 +72,11 @@ TestCase { mouseClick(control); verify(control.checked); - - control.destroy(); } function test_baseline() { - var control = radioDelegate.createObject(testCase); + var control = createTemporaryObject(radioDelegate, testCase); verify(control); compare(control.baselineOffset, control.contentItem.y + control.contentItem.baselineOffset); - control.destroy(); } } -- cgit v1.2.3