diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2016-12-16 16:03:52 +0100 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2016-12-17 09:43:29 +0000 |
commit | 1d88f117f0ee0408d8552c96e8fb41ddee37e3c9 (patch) | |
tree | df58f8a687ff53418d909b0c894bb8bba76a5e0d /tests/auto | |
parent | f27f61fc41fd39a130db76c2c88a3038ea04cc58 (diff) |
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 <jpnurmi@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/controls/data/tst_radiodelegate.qml | 10 |
1 files changed, 3 insertions, 7 deletions
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(); } } |