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_radiobutton.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_radiobutton.qml')
-rw-r--r-- | tests/auto/controls/data/tst_radiobutton.qml | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/tests/auto/controls/data/tst_radiobutton.qml b/tests/auto/controls/data/tst_radiobutton.qml index 8902de70..050cadb7 100644 --- a/tests/auto/controls/data/tst_radiobutton.qml +++ b/tests/auto/controls/data/tst_radiobutton.qml @@ -62,35 +62,22 @@ TestCase { } } - function init() { - } - - function cleanup() { - } - - function test_defaults() { + function test_text() { var control = radioButton.createObject(testCase) verify(control) - verify(control.label) - verify(control.indicator) - compare(control.text, "") - compare(control.pressed, false) - compare(control.checked, false) - control.destroy() - } - function test_text() { - var control = radioButton.createObject(testCase) compare(control.text, "") control.text = "RadioButton" compare(control.text, "RadioButton") control.text = "" compare(control.text, "") + control.destroy() } function test_checked() { var control = radioButton.createObject(testCase) + verify(control) control.spy.expectedSequence = [] // No change expected compare(control.checked, false) @@ -111,6 +98,7 @@ TestCase { function test_mouse() { var control = radioButton.createObject(testCase) + verify(control) // check control.spy.expectedSequence = [["pressedChanged", { "pressed": true, "checked": false }], @@ -171,6 +159,7 @@ TestCase { function test_keys() { var control = radioButton.createObject(testCase) + verify(control) control.spy.expectedSequence = [] control.forceActiveFocus() @@ -221,6 +210,7 @@ TestCase { function test_binding() { var container = twoRadioButtones.createObject(testCase) + verify(container) compare(container.rb1.checked, false) compare(container.rb2.checked, false) |