aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2016-12-16 15:13:24 +0100
committerMitch Curtis <mitch.curtis@qt.io>2016-12-17 09:43:09 +0000
commite70ee6ba3fac19fcfe402825e54e5244e3ca6eb7 (patch)
tree2ed320f084b6a10a2435aa39840decddd30f62ee /tests/auto
parent89ea8f240364ed2a6d4fdfef5e0842155db8f6a3 (diff)
tst_itemdelegate: 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: Ia0ae26235b8e466b80dd674a3d1f530795ade165 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/controls/data/tst_itemdelegate.qml9
1 files changed, 3 insertions, 6 deletions
diff --git a/tests/auto/controls/data/tst_itemdelegate.qml b/tests/auto/controls/data/tst_itemdelegate.qml
index 8eafad57..d5e2b31f 100644
--- a/tests/auto/controls/data/tst_itemdelegate.qml
+++ b/tests/auto/controls/data/tst_itemdelegate.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,20 +56,17 @@ TestCase {
}
function test_baseline() {
- var control = itemDelegate.createObject(testCase)
+ var control = createTemporaryObject(itemDelegate, testCase)
verify(control)
compare(control.baselineOffset, control.contentItem.y + control.contentItem.baselineOffset)
- control.destroy()
}
function test_highlighted() {
- var control = itemDelegate.createObject(testCase)
+ var control = createTemporaryObject(itemDelegate, testCase)
verify(control)
verify(!control.highlighted)
control.highlighted = true
verify(control.highlighted)
-
- control.destroy()
}
}