diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2016-12-16 11:52:33 +0100 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2016-12-16 13:26:13 +0000 |
commit | 712f495eb347084598758d7c40dd09265155a5b2 (patch) | |
tree | 854bce7654b4044a8945da2e76b5137c756f81ac | |
parent | 26832afc970abaab4c382a0f7b5b65b5314e5528 (diff) |
tst_checkdelegate: 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: I459eaa5314c7d64940d97d82812250fe157010bb
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
-rw-r--r-- | tests/auto/controls/data/tst_checkdelegate.qml | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/tests/auto/controls/data/tst_checkdelegate.qml b/tests/auto/controls/data/tst_checkdelegate.qml index 2fa8b4be..03b98fd3 100644 --- a/tests/auto/controls/data/tst_checkdelegate.qml +++ b/tests/auto/controls/data/tst_checkdelegate.qml @@ -58,14 +58,13 @@ TestCase { // TODO: data-fy tst_checkbox (rename to tst_check?) so we don't duplicate its tests here? function test_defaults() { - var control = checkDelegate.createObject(testCase); + var control = createTemporaryObject(checkDelegate, testCase); verify(control); verify(!control.checked); - control.destroy(); } function test_checked() { - var control = checkDelegate.createObject(testCase); + var control = createTemporaryObject(checkDelegate, testCase); verify(control); mouseClick(control); @@ -73,14 +72,11 @@ TestCase { mouseClick(control); verify(!control.checked); - - control.destroy(); } function test_baseline() { - var control = checkDelegate.createObject(testCase); + var control = createTemporaryObject(checkDelegate, testCase); verify(control); compare(control.baselineOffset, control.contentItem.y + control.contentItem.baselineOffset); - control.destroy(); } } |