aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/controls/data/tst_checkdelegate.qml
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2016-12-16 11:52:33 +0100
committerMitch Curtis <mitch.curtis@qt.io>2016-12-16 13:26:13 +0000
commit712f495eb347084598758d7c40dd09265155a5b2 (patch)
tree854bce7654b4044a8945da2e76b5137c756f81ac /tests/auto/controls/data/tst_checkdelegate.qml
parent26832afc970abaab4c382a0f7b5b65b5314e5528 (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>
Diffstat (limited to 'tests/auto/controls/data/tst_checkdelegate.qml')
-rw-r--r--tests/auto/controls/data/tst_checkdelegate.qml10
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();
}
}