aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2021-05-06 12:34:55 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-06-14 14:21:02 +0000
commite5bd177756b7873aa3894da0e85701d4286688c1 (patch)
tree6a5400f43c72873a6354cf7ba8175893f91273e1 /tests
parent10ede696d063de6bd7d3484bdfc8b83cb2ebdd68 (diff)
Fix warnings in some tests
The warnings were all along the lines of: TestCase.qml:672: Error: Cannot assign [undefined] to double At some point the behavior was changed so that you can no longer pass undefined to initial property values, so account for that by having the data rows construct the properties object directly. Change-Id: I7180e9fc664650b87ae0305b7f829cd7266be1ab Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit c2d16c5fdc060f437e6cbee15bfa17c8a7f4ffe2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/controls/data/tst_rangeslider.qml15
-rw-r--r--tests/auto/controls/data/tst_slider.qml12
-rw-r--r--tests/auto/controls/data/tst_spinbox.qml29
-rw-r--r--tests/auto/controls/data/tst_splitview.qml3
4 files changed, 29 insertions, 30 deletions
diff --git a/tests/auto/controls/data/tst_rangeslider.qml b/tests/auto/controls/data/tst_rangeslider.qml
index 24f8a207..d645ec70 100644
--- a/tests/auto/controls/data/tst_rangeslider.qml
+++ b/tests/auto/controls/data/tst_rangeslider.qml
@@ -612,7 +612,7 @@ TestCase {
}
function test_overlappingHandles() {
- var control = createTemporaryObject(sliderComponent, testCase, { orientation: data.orientation })
+ var control = createTemporaryObject(sliderComponent, testCase)
verify(control)
// By default, we force the second handle to be after the first in
@@ -1064,17 +1064,16 @@ TestCase {
function test_valueAt_data() {
return [
- { tag: "0.0..1.0", from: 0.0, to: 1.0, values: [0.0, 0.2, 0.5, 1.0] },
- { tag: "0..100", from: 0, to: 100, values: [0, 20, 50, 100] },
- { tag: "100..-100", from: 100, to: -100, values: [100, 60, 0, -100] },
- { tag: "-7..7", from: -7, to: 7, stepSize: 1.0, values: [-7.0, -4.0, 0.0, 7.0] },
- { tag: "-3..7", from: -3, to: 7, stepSize: 5.0, values: [-3.0, -3.0, 2.0, 7.0] },
+ { tag: "0.0..1.0", properties: { from: 0.0, to: 1.0 }, values: [0.0, 0.2, 0.5, 1.0] },
+ { tag: "0..100", properties: { from: 0, to: 100 }, values: [0, 20, 50, 100] },
+ { tag: "100..-100", properties: { from: 100, to: -100 }, values: [100, 60, 0, -100] },
+ { tag: "-7..7", properties: { from: -7, to: 7, stepSize: 1.0 }, values: [-7.0, -4.0, 0.0, 7.0] },
+ { tag: "-3..7", properties: { from: -3, to: 7, stepSize: 5.0 }, values: [-3.0, -3.0, 2.0, 7.0] },
]
}
function test_valueAt(data) {
- var control = createTemporaryObject(sliderComponent, testCase,
- { from: data.from, to: data.to, stepSize: data.stepSize })
+ var control = createTemporaryObject(sliderComponent, testCase, data.properties)
verify(control)
compare(control.valueAt(0.0), data.values[0])
diff --git a/tests/auto/controls/data/tst_slider.qml b/tests/auto/controls/data/tst_slider.qml
index 280138c5..e1e1ed97 100644
--- a/tests/auto/controls/data/tst_slider.qml
+++ b/tests/auto/controls/data/tst_slider.qml
@@ -831,16 +831,16 @@ TestCase {
function test_valueAt_data() {
return [
- { tag: "0.0..1.0", from: 0.0, to: 1.0, values: [0.0, 0.2, 0.5, 1.0] },
- { tag: "0..100", from: 0, to: 100, values: [0, 20, 50, 100] },
- { tag: "100..-100", from: 100, to: -100, values: [100, 60, 0, -100] },
- { tag: "-7..7", from: -7, to: 7, stepSize: 1.0, values: [-7.0, -4.0, 0.0, 7.0] },
- { tag: "-3..7", from: -3, to: 7, stepSize: 5.0, values: [-3.0, -3.0, 2.0, 7.0] },
+ { tag: "0.0..1.0", properties: { from: 0.0, to: 1.0 }, values: [0.0, 0.2, 0.5, 1.0] },
+ { tag: "0..100", properties: { from: 0, to: 100 }, values: [0, 20, 50, 100] },
+ { tag: "100..-100", properties: { from: 100, to: -100 }, values: [100, 60, 0, -100] },
+ { tag: "-7..7", properties: { from: -7, to: 7, stepSize: 1.0 }, values: [-7.0, -4.0, 0.0, 7.0] },
+ { tag: "-3..7", properties: { from: -3, to: 7, stepSize: 5.0 }, values: [-3.0, -3.0, 2.0, 7.0] },
]
}
function test_valueAt(data) {
- var control = createTemporaryObject(slider, testCase, {from: data.from, to: data.to, stepSize: data.stepSize})
+ let control = createTemporaryObject(slider, testCase, data.properties)
verify(control)
compare(control.valueAt(0.0), data.values[0])
diff --git a/tests/auto/controls/data/tst_spinbox.qml b/tests/auto/controls/data/tst_spinbox.qml
index adb70a30..14ebba21 100644
--- a/tests/auto/controls/data/tst_spinbox.qml
+++ b/tests/auto/controls/data/tst_spinbox.qml
@@ -244,17 +244,17 @@ TestCase {
function test_keys_data() {
return [
- { tag: "1", from: 1, to: 10, value: 1, stepSize: 1, upSteps: [2,3,4], downSteps: [3,2,1,1] },
- { tag: "2", from: 1, to: 10, value: 10, stepSize: 2, upSteps: [10,10], downSteps: [8,6,4] },
- { tag: "25", from: 0, to: 100, value: 50, stepSize: 25, upSteps: [75,100,100], downSteps: [75,50,25,0,0] },
- { tag: "wrap1", wrap: true, from: 1, to: 10, value: 1, stepSize: 1, upSteps: [2,3], downSteps: [2,1,10,9] },
- { tag: "wrap2", wrap: true, from: 1, to: 10, value: 10, stepSize: 2, upSteps: [1,3,5], downSteps: [3,1,10,8,6] },
- { tag: "wrap25", wrap: true, from: 0, to: 100, value: 50, stepSize: 25, upSteps: [75,100,0,25], downSteps: [0,100,75] }
+ { tag: "1", properties: { from: 1, to: 10, value: 1, stepSize: 1 }, upSteps: [2,3,4], downSteps: [3,2,1,1] },
+ { tag: "2", properties: { from: 1, to: 10, value: 10, stepSize: 2 }, upSteps: [10,10], downSteps: [8,6,4] },
+ { tag: "25", properties: { from: 0, to: 100, value: 50, stepSize: 25 }, upSteps: [75,100,100], downSteps: [75,50,25,0,0] },
+ { tag: "wrap1", properties: { wrap: true, from: 1, to: 10, value: 1, stepSize: 1 }, upSteps: [2,3], downSteps: [2,1,10,9] },
+ { tag: "wrap2", properties: { wrap: true, from: 1, to: 10, value: 10, stepSize: 2 }, upSteps: [1,3,5], downSteps: [3,1,10,8,6] },
+ { tag: "wrap25", properties: { wrap: true, from: 0, to: 100, value: 50, stepSize: 25 }, upSteps: [75,100,0,25], downSteps: [0,100,75] }
]
}
function test_keys(data) {
- var control = createTemporaryObject(spinBox, testCase, {wrap: data.wrap, from: data.from, to: data.to, value: data.value, stepSize: data.stepSize})
+ var control = createTemporaryObject(spinBox, testCase, data.properties)
verify(control)
var upPressedCount = 0
@@ -396,12 +396,12 @@ TestCase {
function test_wheel_data() {
return [
- { tag: "1", from: 1, to: 10, value: 1, stepSize: 1, upSteps: [2,3,4], downSteps: [3,2,1,1] },
- { tag: "2", from: 1, to: 10, value: 10, stepSize: 2, upSteps: [10,10], downSteps: [8,6,4] },
- { tag: "25", from: 0, to: 100, value: 50, stepSize: 25, upSteps: [75,100,100], downSteps: [75,50,25,0,0] },
- { tag: "wrap1", wrap: true, from: 1, to: 10, value: 1, stepSize: 1, upSteps: [2,3], downSteps: [2,1,10,9] },
- { tag: "wrap2", wrap: true, from: 1, to: 10, value: 10, stepSize: 2, upSteps: [1,3,5], downSteps: [3,1,10,8,6] },
- { tag: "wrap25", wrap: true, from: 0, to: 100, value: 50, stepSize: 25, upSteps: [75,100,0,25], downSteps: [0,100,75] }
+ { tag: "1", properties: { from: 1, to: 10, value: 1, stepSize: 1 }, upSteps: [2,3,4], downSteps: [3,2,1,1] },
+ { tag: "2", properties: { from: 1, to: 10, value: 10, stepSize: 2 }, upSteps: [10,10], downSteps: [8,6,4] },
+ { tag: "25", properties: { from: 0, to: 100, value: 50, stepSize: 25 }, upSteps: [75,100,100], downSteps: [75,50,25,0,0] },
+ { tag: "wrap1", properties: { wrap: true, from: 1, to: 10, value: 1, stepSize: 1 }, upSteps: [2,3], downSteps: [2,1,10,9] },
+ { tag: "wrap2", properties: { wrap: true, from: 1, to: 10, value: 10, stepSize: 2 }, upSteps: [1,3,5], downSteps: [3,1,10,8,6] },
+ { tag: "wrap25", properties: { wrap: true, from: 0, to: 100, value: 50, stepSize: 25 }, upSteps: [75,100,0,25], downSteps: [0,100,75] }
]
}
@@ -409,7 +409,8 @@ TestCase {
var ma = createTemporaryObject(mouseArea, testCase, {width: 100, height: 100})
verify(ma)
- var control = spinBox.createObject(ma, {wrap: data.wrap, from: data.from, to: data.to, value: data.value, stepSize: data.stepSize, wheelEnabled: true})
+ data.properties.wheelEnabled = true
+ var control = spinBox.createObject(ma, data.properties)
verify(control)
var valueModifiedCount = 0
diff --git a/tests/auto/controls/data/tst_splitview.qml b/tests/auto/controls/data/tst_splitview.qml
index ae8179b2..aa167472 100644
--- a/tests/auto/controls/data/tst_splitview.qml
+++ b/tests/auto/controls/data/tst_splitview.qml
@@ -1838,8 +1838,7 @@ TestCase {
var flickable = createTemporaryObject(flickableComponent, testCase)
verify(flickable)
- var control = threeSizedItemsComponent.createObject(flickable.contentItem,
- { "orientation": data.orientation })
+ var control = threeSizedItemsComponent.createObject(flickable.contentItem)
verify(control)
control.anchors.fill = undefined