]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/tests/placesitemmodeltest.cpp
[PlacesItemModelTest] Try to use an event loop instead of an hardcoded timeout
[dolphin.git] / src / tests / placesitemmodeltest.cpp
index 40ee47cbc9beb514eb71a0cb327cc67e3da6feed..73204954b9ffbad71ec708d1f6f89437ffa559c5 100644 (file)
@@ -735,10 +735,13 @@ void PlacesItemModelTest::testRefresh()
     QVERIFY(item->text() != sameItem->text());
 
     // propagate change
+    QEventLoop eventLoop;
+    connect(m_model, &PlacesItemModel::sourceModelDataChanged, &eventLoop, &QEventLoop::quit);
     m_model->refresh();
+    eventLoop.exec();
 
     // item must be equal
-    QTRY_COMPARE(item->text(), sameItem->text());
+    QCOMPARE(item->text(), sameItem->text());
 }
 
 void PlacesItemModelTest::testIcons_data()