From 25b08ded08e7b581215a4e89f43c4a1509c13f4a Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Sat, 14 Nov 2015 00:06:40 +0100 Subject: Query test adjustments --- tests/querytest.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/querytest.cpp b/tests/querytest.cpp index 47d977b..e4f1d0d 100644 --- a/tests/querytest.cpp +++ b/tests/querytest.cpp @@ -55,8 +55,10 @@ private Q_SLOTS: Akonadi2::Query query; query.resources << "org.kde.dummy.instance1"; query.syncOnDemand = false; - query.processAll = true; + query.processAll = false; + query.liveQuery = true; + //We fetch before the data is available and rely on the live query mechanism to deliver the actual data auto model = Akonadi2::Store::loadModel(query); model->fetchMore(QModelIndex()); QTRY_COMPARE(model->rowCount(), 1); @@ -75,10 +77,14 @@ private Q_SLOTS: query.resources << "org.kde.dummy.instance1"; query.syncOnDemand = false; query.processAll = true; - query.liveQuery = true; + query.liveQuery = false; + //We fetch after the data is available and don't rely on the live query mechanism to deliver the actual data auto model = Akonadi2::Store::loadModel(query); - QTest::qWait(200); + + //Ensure all local data is processed + Akonadi2::Store::synchronize(query).exec().waitForFinished(); + model->fetchMore(QModelIndex()); QVERIFY(model->rowCount() < 2); QTRY_COMPARE(model->rowCount(), 1); -- cgit v1.2.3