aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/controls/data/tst_stackview.qml
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2015-06-29 19:14:55 +0200
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2015-06-29 17:56:58 +0000
commite7869a71faf9d3b2c120e734c7323df0bf41dff6 (patch)
treef7aef5868b2379d80bf726407375a64990dcd279 /tests/auto/controls/data/tst_stackview.qml
parent68e45b4852c2fa3a7722619470d35fb506d44a54 (diff)
Cleanup & improve auto tests
- always verify component creation to catch errors early - remove empty init() and cleanup() functions - remove redundant "defaults" checks Change-Id: I39f16404fa2e3d3e38348742afd8f51ea36b2f05 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'tests/auto/controls/data/tst_stackview.qml')
-rw-r--r--tests/auto/controls/data/tst_stackview.qml29
1 files changed, 11 insertions, 18 deletions
diff --git a/tests/auto/controls/data/tst_stackview.qml b/tests/auto/controls/data/tst_stackview.qml
index 3e87853d..2d406e1b 100644
--- a/tests/auto/controls/data/tst_stackview.qml
+++ b/tests/auto/controls/data/tst_stackview.qml
@@ -59,28 +59,21 @@ TestCase {
StackView { }
}
- function test_defaults() {
- var control = stackView.createObject(testCase)
- verify(control)
- verify(control.pushEnter)
- verify(control.pushExit)
- verify(control.popEnter)
- verify(control.popExit)
- compare(control.depth, 0)
- compare(control.busy, false)
- compare(control.currentItem, null)
- compare(control.initialItem, undefined)
- control.destroy()
- }
-
function test_initialItem() {
- var control1 = stackView.createObject(testCase, {initialItem: item})
- compare(control1.currentItem, item)
+ var control1 = stackView.createObject(testCase)
+ verify(control1)
+ compare(control1.currentItem, null)
control1.destroy()
- var control2 = stackView.createObject(testCase, {initialItem: component})
- verify(control2.currentItem)
+ var control2 = stackView.createObject(testCase, {initialItem: item})
+ verify(control2)
+ compare(control2.currentItem, item)
control2.destroy()
+
+ var control3 = stackView.createObject(testCase, {initialItem: component})
+ verify(control3)
+ verify(control3.currentItem)
+ control3.destroy()
}
function test_currentItem() {