diff options
author | J-P Nurmi <jpnurmi@theqtcompany.com> | 2015-06-29 19:14:55 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@theqtcompany.com> | 2015-06-29 17:56:58 +0000 |
commit | e7869a71faf9d3b2c120e734c7323df0bf41dff6 (patch) | |
tree | f7aef5868b2379d80bf726407375a64990dcd279 /tests/auto/controls/data/tst_scrollbar.qml | |
parent | 68e45b4852c2fa3a7722619470d35fb506d44a54 (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_scrollbar.qml')
-rw-r--r-- | tests/auto/controls/data/tst_scrollbar.qml | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/tests/auto/controls/data/tst_scrollbar.qml b/tests/auto/controls/data/tst_scrollbar.qml index d4033622..6e1a328c 100644 --- a/tests/auto/controls/data/tst_scrollbar.qml +++ b/tests/auto/controls/data/tst_scrollbar.qml @@ -82,23 +82,18 @@ TestCase { pressedSpy.clear() } - function test_defaults() { - var control = scrollBar.createObject(testCase) - verify(control) - verify(control.handle) - compare(control.size, 0.0) - compare(control.position, 0.0) - compare(control.active, false) - compare(control.orientation, Qt.Vertical) - control.destroy() - } - function test_attach() { var container = flickable.createObject(testCase) + verify(container) waitForRendering(container) var vertical = scrollBar.createObject() verify(!vertical.parent) + compare(vertical.size, 0.0) + compare(vertical.position, 0.0) + compare(vertical.active, false) + compare(vertical.orientation, Qt.Vertical) + container.AbstractScrollBar.vertical = vertical compare(vertical.parent, container) compare(vertical.orientation, Qt.Vertical) @@ -107,6 +102,11 @@ TestCase { var horizontal = scrollBar.createObject() verify(!horizontal.parent) + compare(horizontal.size, 0.0) + compare(horizontal.position, 0.0) + compare(horizontal.active, false) + compare(horizontal.orientation, Qt.Vertical) + container.AbstractScrollBar.horizontal = horizontal compare(horizontal.parent, container) compare(horizontal.orientation, Qt.Horizontal) @@ -147,6 +147,7 @@ TestCase { function test_mouse(data) { var control = scrollBar.createObject(testCase, data.properties) + verify(control) pressedSpy.target = control verify(pressedSpy.valid) |