diff options
| author | Elvis Angelaccio <[email protected]> | 2018-10-13 12:06:21 +0200 |
|---|---|---|
| committer | Elvis Angelaccio <[email protected]> | 2018-10-13 12:09:32 +0200 |
| commit | c527dc217234e6a2dba4d9ee08945c17b9a215bd (patch) | |
| tree | ec08d906af40d93d8b91dec722d5d4a16ad88e7e /src/tests | |
| parent | c9dd3478be21bc8a4bbd6102b1d66997df180d5f (diff) | |
[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.
Diffstat (limited to 'src/tests')
| -rw-r--r-- | src/tests/placesitemmodeltest.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
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() |
