diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2016-12-16 15:15:06 +0100 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2016-12-17 09:43:12 +0000 |
commit | a9c661da8d0b430e169899d963a5d224a4f05852 (patch) | |
tree | 5a95d47103ebb794cf82e6b45e846662ae54fe0d /tests/auto | |
parent | e70ee6ba3fac19fcfe402825e54e5244e3ca6eb7 (diff) |
tst_label: 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: I35f93fe3777ddaa2eca3239b4eb28030cf3dfe3b
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/controls/data/tst_label.qml | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/tests/auto/controls/data/tst_label.qml b/tests/auto/controls/data/tst_label.qml index b3350cf5..bedf06a3 100644 --- a/tests/auto/controls/data/tst_label.qml +++ b/tests/auto/controls/data/tst_label.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. @@ -61,9 +61,8 @@ TestCase { } function test_creation() { - var control = label.createObject(testCase) + var control = createTemporaryObject(label, testCase) verify(control) - control.destroy() } function test_font_explicit_attributes_data() { @@ -80,7 +79,7 @@ TestCase { } function test_font_explicit_attributes(data) { - var control = label.createObject(testCase) + var control = createTemporaryObject(label, testCase) verify(control) var child = label.createObject(control) @@ -105,7 +104,5 @@ TestCase { compare(child.font[data.tag], defaultValue) compare(childSpy.count, 0) - - control.destroy() } } |