diff options
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/controls/data/tst_dial.qml | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/auto/controls/data/tst_dial.qml b/tests/auto/controls/data/tst_dial.qml index 98c3a002..3b20e91d 100644 --- a/tests/auto/controls/data/tst_dial.qml +++ b/tests/auto/controls/data/tst_dial.qml @@ -465,7 +465,7 @@ TestCase { compare(dial.value, dial.to); } - function test_snapMode_data() { + function test_snapMode_data(immediate) { return [ { tag: "NoSnap", snapMode: Slider.NoSnap, from: 0, to: 2, values: [0, 0, 1], positions: [0, 0.5, 0.5] }, { tag: "SnapAlways (0..2)", snapMode: Slider.SnapAlways, from: 0, to: 2, values: [0.0, 0.0, 1.0], positions: [0.0, 0.5, 0.5] }, @@ -474,13 +474,13 @@ TestCase { { tag: "SnapAlways (1..-1)", snapMode: Slider.SnapAlways, from: 1, to: -1, values: [1.0, 1.0, 0.0], positions: [0.0, 0.5, 0.5] }, { tag: "SnapOnRelease (0..2)", snapMode: Slider.SnapOnRelease, from: 0, to: 2, values: [0.0, 0.0, 1.0], positions: [0.0, 0.5, 0.5] }, { tag: "SnapOnRelease (1..3)", snapMode: Slider.SnapOnRelease, from: 1, to: 3, values: [1.0, 1.0, 2.0], positions: [0.0, 0.5, 0.5] }, - { tag: "SnapOnRelease (-1..1)", snapMode: Slider.SnapOnRelease, from: -1, to: 1, values: [0.0, 0.0, 0.0], positions: [0.5, 0.5, 0.5] }, + { tag: "SnapOnRelease (-1..1)", snapMode: Slider.SnapOnRelease, from: -1, to: 1, values: [0.0, 0.0, 0.0], positions: [immediate ? 0.0 : 0.5, 0.5, 0.5] }, { tag: "SnapOnRelease (1..-1)", snapMode: Slider.SnapOnRelease, from: 1, to: -1, values: [1.0, 1.0, 0.0], positions: [0.0, 0.5, 0.5] } ] } function test_snapMode_mouse_data() { - return test_snapMode_data() + return test_snapMode_data(true) } function test_snapMode_mouse(data) { @@ -492,11 +492,11 @@ TestCase { dial.to = data.to; dial.stepSize = 0.2; - var fuzz = 0.05; + var fuzz = 0.055; mousePress(dial, dial.width * 0.25, dial.height * 0.75); - compare(dial.value, data.values[0]); - compare(dial.position, data.positions[0]); + fuzzyCompare(dial.value, data.values[0], fuzz); + fuzzyCompare(dial.position, data.positions[0], fuzz); mouseMove(dial, dial.width * 0.5, dial.height * 0.25); fuzzyCompare(dial.value, data.values[1], fuzz); @@ -508,7 +508,7 @@ TestCase { } function test_snapMode_touch_data() { - return test_snapMode_data() + return test_snapMode_data(false) } function test_snapMode_touch(data) { |