From f6126ccb1ccb0c0d87dfd36da22daf403ef1f445 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Lefebvre?= Date: Tue, 27 May 2025 12:45:22 +0200 Subject: [PATCH] Fix flaky tst_QScroller::overshoot on multiple Windows versions tst_QScroller::overshoot is flaky on multiple versions of Windows 11. The failure occurs in the part testing overshoot always off and slow, where the result of the deltaPos and the startPos are equal to 0 instead of being smaller. Slightly increase the value of touchEnd so that deltaPos is smaller. As a drive-by, constify a local variable. Fix the flakiness on Windows 11 24h2 mingw. Fixes: QTBUG-137201 Change-Id: I6dacc7b5ac140f427fa6fbb8fddb5447ae14a233 Reviewed-by: Axel Spoerl --- tests/auto/widgets/util/qscroller/tst_qscroller.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/auto/widgets/util/qscroller/tst_qscroller.cpp b/tests/auto/widgets/util/qscroller/tst_qscroller.cpp index 8cd4d78aac1..93191fde422 100644 --- a/tests/auto/widgets/util/qscroller/tst_qscroller.cpp +++ b/tests/auto/widgets/util/qscroller/tst_qscroller.cpp @@ -482,12 +482,12 @@ void tst_QScroller::overshoot() sp1.setScrollMetric(QScrollerProperties::HorizontalOvershootPolicy, QVariant::fromValue(QScrollerProperties::OvershootAlwaysOff)); s1->setScrollerProperties(sp1); - kineticScrollNoTest(sw.data(), QPointF(500, 500), QPoint(0, 0), QPoint(200, 0), QPoint(215, 0)); + kineticScrollNoTest(sw.data(), QPointF(500, 500), QPoint(0, 0), QPoint(200, 0), QPoint(250, 0)); // Check that segment parameters are consistent QScrollerPrivate* priv = s1->d_func(); QVERIFY(priv->xSegments.size() == 1); - auto& segment = priv->xSegments.head(); + const auto& segment = priv->xSegments.head(); QCOMPARE_LT(segment.startPos + segment.deltaPos, segment.stopPos); QTRY_COMPARE(s1->state(), QScroller::Inactive);