summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2017-02-20 11:16:28 +0100
committerMitch Curtis <mitch.curtis@qt.io>2017-02-21 08:50:14 +0000
commitf2627ef19b92eeef3b836e1b5012fd14e3a8a88f (patch)
tree5a5ebef294609a20fe8c5c2879527c98346bcf71 /tests
parentf3a0c9680b264fc7f2f9e4ac3fe43d0c8321fbef (diff)
downloadqtquickcontrols-f2627ef19b92eeef3b836e1b5012fd14e3a8a88f.tar.gz
tst_gauge: try to stabilize test_gaugeTickmarkValues()
This is failing sporadically on Windows 10. Replace wait(0) with a more reliable tryCompare() check. Task-number: QTBUG-58859 Change-Id: Ia2010afd17051334717e944d8c303f757c14a6b0 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/extras/data/tst_gauge.qml18
1 files changed, 8 insertions, 10 deletions
diff --git a/tests/auto/extras/data/tst_gauge.qml b/tests/auto/extras/data/tst_gauge.qml
index 6fdd6be6..77dd099d 100644
--- a/tests/auto/extras/data/tst_gauge.qml
+++ b/tests/auto/extras/data/tst_gauge.qml
@@ -254,28 +254,26 @@ TestCase {
gauge.height = gaugeHeightFor100PixelHighValueBar(gauge);
compare(gauge.__panel.barLength, 100);
- // Give stuff time to re-layout after the new control height, etc.,
- // otherwise we'll be comparing against incorrect pixel positions.
- wait(0);
-
for (var tickmarkIndex = 0; tickmarkIndex < data.expectedTickmarkValues.length; ++tickmarkIndex) {
var tickmark = TestUtils.findChild(gauge, "tickmark" + tickmarkIndex);
- compare(tickmark.value, data.expectedTickmarkValues[tickmarkIndex],
- "Value of tickmark at index " + tickmarkIndex + " is " + data.expectedTickmarkValues[tickmarkIndex]);
+ // QTBUG-58859: give stuff time to re-layout after the new control height, etc.,
+ // otherwise we'll be comparing against incorrect pixel positions.
+ tryCompare(tickmark, "value", data.expectedTickmarkValues[tickmarkIndex], undefined,
+ "Value of tickmark at index " + tickmarkIndex + " should be " + data.expectedTickmarkValues[tickmarkIndex]);
var expectedValuePos = data.expectedTickmarkValuePositions[tickmarkIndex];
- compare(tickmark.valuePosition, expectedValuePos,
- "Value position of tickmark at index " + tickmarkIndex + " is " + expectedValuePos);
+ tryCompare(tickmark, "valuePosition", expectedValuePos, undefined,
+ "Value position of tickmark at index " + tickmarkIndex + " should be " + expectedValuePos);
}
for (var minorTickmarkIndex = 0; minorTickmarkIndex < data.expectedMinorTickmarkValues.length; ++minorTickmarkIndex) {
var minorTickmark = TestUtils.findChild(gauge, "minorTickmark" + minorTickmarkIndex);
compare(minorTickmark.value, data.expectedMinorTickmarkValues[minorTickmarkIndex],
- "Value of minor tickmark at index " + minorTickmarkIndex + " is " + data.expectedMinorTickmarkValues[minorTickmarkIndex]);
+ "Value of minor tickmark at index " + minorTickmarkIndex + " should be " + data.expectedMinorTickmarkValues[minorTickmarkIndex]);
expectedValuePos = data.expectedMinorTickmarkValuePositions[minorTickmarkIndex];
compare(minorTickmark.valuePosition, expectedValuePos,
- "Value position of minor tickmark at index " + minorTickmarkIndex + " is " + expectedValuePos);
+ "Value position of minor tickmark at index " + minorTickmarkIndex + " should be " + expectedValuePos);
}
}