diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2016-12-16 15:48:14 +0100 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2016-12-17 09:43:25 +0000 |
commit | a68ae314c4b1d833b8eb18745cad0f0cbc2d502c (patch) | |
tree | 8eaf6d4e4f26bb1171bfe7303000e1f990a1c7bc /tests/auto | |
parent | 3ffa8ab293dcca9f76adfc5e314fefa091e58a23 (diff) |
tst_progressbar: 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: Ia0b8bb7e27a3bd1a1af863d1b56a89e089c5663f
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/controls/data/tst_progressbar.qml | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/tests/auto/controls/data/tst_progressbar.qml b/tests/auto/controls/data/tst_progressbar.qml index d7280503..a48dd940 100644 --- a/tests/auto/controls/data/tst_progressbar.qml +++ b/tests/auto/controls/data/tst_progressbar.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,7 +56,7 @@ TestCase { } function test_value() { - var control = progressBar.createObject(testCase) + var control = createTemporaryObject(progressBar, testCase) verify(control) compare(control.value, 0.0) @@ -68,12 +68,10 @@ TestCase { compare(control.value, 0.0) control.value = 2.0 compare(control.value, 1.0) - - control.destroy() } function test_range() { - var control = progressBar.createObject(testCase, {from: 0, to: 100, value: 50}) + var control = createTemporaryObject(progressBar, testCase, {from: 0, to: 100, value: 50}) verify(control) compare(control.from, 0) @@ -102,12 +100,10 @@ TestCase { control.value = 50 compare(control.value, 50) compare(control.position, 0.5) - - control.destroy() } function test_inverted() { - var control = progressBar.createObject(testCase, {from: 1.0, to: -1.0}) + var control = createTemporaryObject(progressBar, testCase, {from: 1.0, to: -1.0}) verify(control) compare(control.from, 1.0) @@ -126,12 +122,10 @@ TestCase { control.value = 0.0 compare(control.value, 0.0) compare(control.position, 0.5) - - control.destroy() } function test_position() { - var control = progressBar.createObject(testCase) + var control = createTemporaryObject(progressBar, testCase) verify(control) compare(control.value, 0) @@ -144,12 +138,10 @@ TestCase { control.value = 0.75 compare(control.value, 0.75) compare(control.position, 0.75) - - control.destroy() } function test_visualPosition() { - var control = progressBar.createObject(testCase) + var control = createTemporaryObject(progressBar, testCase) verify(control) compare(control.value, 0) @@ -178,12 +170,10 @@ TestCase { // LayoutMirroring control.LayoutMirroring.enabled = true compare(control.visualPosition, 0.75) - - control.destroy() } function test_indeterminate() { - var control = progressBar.createObject(testCase) + var control = createTemporaryObject(progressBar, testCase) verify(control) compare(control.indeterminate, false) @@ -192,7 +182,5 @@ TestCase { wait(100) // Shouldn't crash... control.indeterminate = false - - control.destroy() } } |