aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/controls/data/tst_control.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_control.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_control.qml')
-rw-r--r--tests/auto/controls/data/tst_control.qml14
1 files changed, 5 insertions, 9 deletions
diff --git a/tests/auto/controls/data/tst_control.qml b/tests/auto/controls/data/tst_control.qml
index 555328a1..d8b1e3df 100644
--- a/tests/auto/controls/data/tst_control.qml
+++ b/tests/auto/controls/data/tst_control.qml
@@ -70,12 +70,10 @@ TestCase {
signalName: "mirroredChanged"
}
- function test_defaults() {
+ function test_padding() {
var control = component.createObject(testCase)
verify(control)
- compare(control.layoutDirection, Qt.LeftToRight)
- compare(control.effectiveLayoutDirection, Qt.LeftToRight)
- compare(control.mirrored, false)
+
compare(control.padding, 0)
compare(control.topPadding, 0)
compare(control.leftPadding, 0)
@@ -83,11 +81,6 @@ TestCase {
compare(control.bottomPadding, 0)
compare(control.availableWidth, 0)
compare(control.availableHeight, 0)
- control.destroy()
- }
-
- function test_padding() {
- var control = component.createObject(testCase)
control.width = 100
control.height = 100
@@ -139,6 +132,7 @@ TestCase {
function test_availableSize() {
var control = component.createObject(testCase)
+ verify(control)
control.width = 100
control.height = 100
@@ -174,6 +168,7 @@ TestCase {
function test_layoutDirection() {
var control = component.createObject(testCase)
+ verify(control)
layoutDirectionSpy.target = control
effectiveLayoutDirectionSpy.target = control
@@ -225,6 +220,7 @@ TestCase {
function test_background() {
var control = component.createObject(testCase)
+ verify(control)
control.background = component.createObject(control)