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 <axel.spoerl@qt.io>
This commit is contained in:
Frédéric Lefebvre 2024-11-12 16:02:31 +01:00 committed by Frederic Lefebvre
parent 5f2d5aa4a4
commit 001a988120

View File

@ -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[] = {