From 001a988120bea43a6bb47f82445c6baaa5935783 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Lefebvre?= Date: Tue, 12 Nov 2024 16:02:31 +0100 Subject: [PATCH] Tst_QWidget::dumpObjectTree verify position before dumpObjectTree Verify position of the widget w, before checking the result of the dumpObjectTree(). Remove the flakiness of this auto-test. Add a QPoint pos of the original position of the widget and use a QCompare to verify that it is still the correct one before checking the output of dumpObjectTree. Change-Id: I71938676e614fe0667c11242a08db47802fdba3b Reviewed-by: Axel Spoerl --- tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp index 73d96c630f5..7f3e204ec68 100644 --- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp +++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp @@ -9712,6 +9712,7 @@ void tst_QWidget::dumpObjectTree() Q_SET_OBJECT_NAME(w); w.move(100, 100); w.resize(200, 200); + QPoint pos = w.pos(); QLineEdit le(&w); Q_SET_OBJECT_NAME(le); @@ -9730,6 +9731,7 @@ void tst_QWidget::dumpObjectTree() QTestPrivate::androidCompatibleShow(&w); QVERIFY(QTest::qWaitForWindowActive(&w)); + QTRY_COMPARE(w.pos(), pos); { const char * const expected[] = {