diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2020-11-06 17:42:08 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2020-11-06 19:50:39 +0100 |
commit | 10ff6760ef828de5d1dcaec5f490c107fd8c9468 (patch) | |
tree | 1a957598d6f4be9a8bc223af6cb5ec221d957ef4 | |
parent | 4122d88ae9d0b2e2147b6e91d211a25b2e108e1b (diff) |
Stabilize tst_QQuickDropArea::containsDrag_internal
It seems timing-sensitive; as usual when we have processEvents()
and then QCOMPARE, it's often better to just use QTRY_COMPARE in case
it runs slower than expected on CI VMs.
Fixes: QTBUG-88206
Change-Id: Ie6916a00e16e025c32940e6bffcabd1159480c5a
Reviewed-by: Liang Qi <liang.qi@qt.io>
-rw-r--r-- | tests/auto/quick/qquickdroparea/tst_qquickdroparea.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/tests/auto/quick/qquickdroparea/tst_qquickdroparea.cpp b/tests/auto/quick/qquickdroparea/tst_qquickdroparea.cpp index dcba4c872e..593f3a0efb 100644 --- a/tests/auto/quick/qquickdroparea/tst_qquickdroparea.cpp +++ b/tests/auto/quick/qquickdroparea/tst_qquickdroparea.cpp @@ -134,17 +134,14 @@ void tst_QQuickDropArea::containsDrag_internal() QCOMPARE(evaluate<int>(dropArea, "exitEvents"), 0); dragItem->setPosition(QPointF(50, 50)); - QCoreApplication::processEvents(); - QCOMPARE(evaluate<bool>(dropArea, "containsDrag"), true); + QTRY_COMPARE(evaluate<bool>(dropArea, "containsDrag"), true); QCOMPARE(evaluate<bool>(dropArea, "hasDrag"), true); QCOMPARE(evaluate<int>(dropArea, "enterEvents"), 1); QCOMPARE(evaluate<int>(dropArea, "exitEvents"), 0); evaluate<void>(dropArea, "{ enterEvents = 0; exitEvents = 0 }"); dragItem->setPosition(QPointF(150, 50)); - QCoreApplication::processEvents(); - - QCOMPARE(evaluate<bool>(dropArea, "containsDrag"), false); + QTRY_COMPARE(evaluate<bool>(dropArea, "containsDrag"), false); QCOMPARE(evaluate<bool>(dropArea, "hasDrag"), false); QCOMPARE(evaluate<int>(dropArea, "enterEvents"), 0); QCOMPARE(evaluate<int>(dropArea, "exitEvents"), 1); |