aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2016-12-20 10:06:53 +0100
committerMitch Curtis <mitch.curtis@qt.io>2016-12-21 11:45:42 +0000
commit7aee63b8a5db7721e079e1a3402a3ca6b4b1d06e (patch)
tree2d4dc176209ea3ce473a161830ee96a287c9ba48 /tests
parent027613c1fa2d82511b40aeefdab8d28bf9730278 (diff)
tst_scrollindicator: 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: If25a058a6855e747ef3b5f253f486188593493a9 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/controls/data/tst_scrollindicator.qml14
1 files changed, 5 insertions, 9 deletions
diff --git a/tests/auto/controls/data/tst_scrollindicator.qml b/tests/auto/controls/data/tst_scrollindicator.qml
index 1ec03b15..23579426 100644
--- a/tests/auto/controls/data/tst_scrollindicator.qml
+++ b/tests/auto/controls/data/tst_scrollindicator.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.
@@ -68,11 +68,11 @@ TestCase {
}
function test_attach() {
- var container = flickable.createObject(testCase)
+ var container = createTemporaryObject(flickable, testCase)
verify(container)
waitForRendering(container)
- var vertical = scrollIndicator.createObject()
+ var vertical = createTemporaryObject(scrollIndicator, null)
verify(!vertical.parent)
compare(vertical.size, 0.0)
compare(vertical.position, 0.0)
@@ -100,7 +100,7 @@ TestCase {
container.width += 10
compare(vertical.x, 123)
- var horizontal = scrollIndicator.createObject()
+ var horizontal = createTemporaryObject(scrollIndicator, null)
verify(!horizontal.parent)
compare(horizontal.size, 0.0)
compare(horizontal.position, 0.0)
@@ -165,8 +165,6 @@ TestCase {
container.width += 10
compare(horizontal.x, oldX - 10)
compare(horizontal.width, oldWidth)
-
- container.destroy()
}
function test_warning() {
@@ -175,7 +173,7 @@ TestCase {
}
function test_overshoot() {
- var container = flickable.createObject(testCase)
+ var container = createTemporaryObject(flickable, testCase)
verify(container)
waitForRendering(container)
@@ -204,7 +202,5 @@ TestCase {
horizontal.position = 0.8
compare(horizontal.contentItem.x, horizontal.leftPadding + 0.8 * horizontal.availableWidth)
compare(horizontal.contentItem.width, 0.2 * horizontal.availableWidth)
-
- container.destroy()
}
}