Use QTRY_COMPARE in an attempt to make the test less flaky

The test function only runs on X11, and this might help with the
asynchronous nature of the client/server architecture, also for
drag'n'drop.

Change-Id: I38db9104e304e57c36f84932d13f8dfae7452883
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
bb10
Volker Hilsheimer 2020-11-10 22:05:20 +01:00
parent d04e117d3d
commit ee025760cf
1 changed files with 2 additions and 2 deletions

View File

@ -2699,12 +2699,12 @@ void tst_QListView::internalDragDropMove()
list.startDrag(Qt::MoveAction);
QCOMPARE(data.stringList(), expectedData);
QTRY_COMPARE(data.stringList(), expectedData);
// if the model doesn't implement moveRows, or if items are replaced, then selection is lost
if (modelMoves && !(itemFlags & Qt::ItemIsDropEnabled)) {
const QStringList actualSelected = getSelectedTexts();
QCOMPARE(actualSelected, expectedSelected);
QTRY_COMPARE(actualSelected, expectedSelected);
}
}