diff options
author | Kari Oikarinen <kari.oikarinen@qt.io> | 2019-11-26 14:49:20 +0200 |
---|---|---|
committer | Kari Oikarinen <kari.oikarinen@qt.io> | 2019-11-26 14:49:20 +0200 |
commit | 0d2fc12b65028b4f04bdace3991448813130ab48 (patch) | |
tree | 3666621eced42e3a2f663085a6fd969585edada9 /tests/auto/controls/data/tst_dial.qml | |
parent | 546539562f2aff985e78f3c2426cb711a865ad65 (diff) | |
parent | f9877da406ad96d82becb15b6eef9b723b8807e3 (diff) |
Merge 5.14 into 5.14.0v5.14.0-rc2v5.14.0-rc1v5.14.0
Change-Id: Ieaab5ab5723972fe3cdcb2245f53caad1ee63a5e
Diffstat (limited to 'tests/auto/controls/data/tst_dial.qml')
-rw-r--r-- | tests/auto/controls/data/tst_dial.qml | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/tests/auto/controls/data/tst_dial.qml b/tests/auto/controls/data/tst_dial.qml index 86999594..26f30c33 100644 --- a/tests/auto/controls/data/tst_dial.qml +++ b/tests/auto/controls/data/tst_dial.qml @@ -223,33 +223,39 @@ TestCase { var minimumExpectedValueCount = data.live ? 2 : 1; // drag to the left - mouseDrag(dial, dial.width / 2, dial.height / 2, -dial.width / 2, 0, Qt.LeftButton); + // we always add or subtract 1 to ensure we start the drag from the opposite side + // of where we're dragging to, for more reliable tests + mouseDrag(dial, dial.width / 2 + 1, dial.height / 2, -dial.width / 2, 0, Qt.LeftButton); fuzzyCompare(dial.value, data.leftValue, 0.1); - verify(valueSpy.count >= minimumExpectedValueCount); + verify(valueSpy.count >= minimumExpectedValueCount, "expected valueChanged to be emitted at least " + + minimumExpectedValueCount + " time(s), but it was only emitted " + valueSpy.count + " time(s)"); valueSpy.clear(); verify(moveSpy.count > 0); moveSpy.clear(); // drag to the top - mouseDrag(dial, dial.width / 2, dial.height / 2, 0, -dial.height / 2, Qt.LeftButton); + mouseDrag(dial, dial.width / 2, dial.height / 2 + 1, 0, -dial.height / 2, Qt.LeftButton); fuzzyCompare(dial.value, data.topValue, 0.1); - verify(valueSpy.count >= minimumExpectedValueCount); + verify(valueSpy.count >= minimumExpectedValueCount, "expected valueChanged to be emitted at least " + + minimumExpectedValueCount + " time(s), but it was only emitted " + valueSpy.count + " time(s)"); valueSpy.clear(); verify(moveSpy.count > 0); moveSpy.clear(); // drag to the right - mouseDrag(dial, dial.width / 2, dial.height / 2, dial.width / 2, 0, Qt.LeftButton); + mouseDrag(dial, dial.width / 2 - 1, dial.height / 2, dial.width / 2, 0, Qt.LeftButton); fuzzyCompare(dial.value, data.rightValue, 0.1); - verify(valueSpy.count >= minimumExpectedValueCount); + verify(valueSpy.count >= minimumExpectedValueCount, "expected valueChanged to be emitted at least " + + minimumExpectedValueCount + " time(s), but it was only emitted " + valueSpy.count + " time(s)"); valueSpy.clear(); verify(moveSpy.count > 0); moveSpy.clear(); // drag to the bottom (* 0.6 to ensure we don't go over to the minimum position) - mouseDrag(dial, dial.width / 2, dial.height / 2, 10, dial.height / 2, Qt.LeftButton); + mouseDrag(dial, dial.width / 2, dial.height / 2 - 1, 10, dial.height / 2, Qt.LeftButton); fuzzyCompare(dial.value, data.bottomValue, 0.1); - verify(valueSpy.count >= minimumExpectedValueCount); + verify(valueSpy.count >= minimumExpectedValueCount, "expected valueChanged to be emitted at least " + + minimumExpectedValueCount + " time(s), but it was only emitted " + valueSpy.count + " time(s)"); valueSpy.clear(); verify(moveSpy.count > 0); moveSpy.clear(); |