From c527dc217234e6a2dba4d9ee08945c17b9a215bd Mon Sep 17 00:00:00 2001 From: Elvis Angelaccio Date: Sat, 13 Oct 2018 12:06:21 +0200 Subject: [PlacesItemModelTest] Try to use an event loop instead of an hardcoded timeout Increasing the timeout from 5 to 10 seconds didn't work. Let's see if an eventloop does the job. --- src/tests/placesitemmodeltest.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/tests') diff --git a/src/tests/placesitemmodeltest.cpp b/src/tests/placesitemmodeltest.cpp index c05ce6882..73204954b 100644 --- a/src/tests/placesitemmodeltest.cpp +++ b/src/tests/placesitemmodeltest.cpp @@ -43,11 +43,6 @@ Q_DECLARE_METATYPE(KItemRange) #define KDE_ROOT_PATH "/" #endif -namespace -{ - constexpr int TIMEOUT = 10000; -} - static QString bookmarksFile() { return QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/user-places.xbel"; @@ -740,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_WITH_TIMEOUT(item->text(), sameItem->text(), TIMEOUT); + QCOMPARE(item->text(), sameItem->text()); } void PlacesItemModelTest::testIcons_data() -- cgit v1.3