summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2015-11-14 00:06:40 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2015-11-14 00:06:40 +0100
commit25b08ded08e7b581215a4e89f43c4a1509c13f4a (patch)
treeebb28d16c3d236529c5761a9ae158ed0827b83b9
parent75c231f0758603120ec562af772b48b5f6ac0e24 (diff)
downloadsink-25b08ded08e7b581215a4e89f43c4a1509c13f4a.tar.gz
sink-25b08ded08e7b581215a4e89f43c4a1509c13f4a.zip
Query test adjustments
-rw-r--r--tests/querytest.cpp12
1 files changed, 9 insertions, 3 deletions
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:
55 Akonadi2::Query query; 55 Akonadi2::Query query;
56 query.resources << "org.kde.dummy.instance1"; 56 query.resources << "org.kde.dummy.instance1";
57 query.syncOnDemand = false; 57 query.syncOnDemand = false;
58 query.processAll = true; 58 query.processAll = false;
59 query.liveQuery = true;
59 60
61 //We fetch before the data is available and rely on the live query mechanism to deliver the actual data
60 auto model = Akonadi2::Store::loadModel<Akonadi2::ApplicationDomain::Mail>(query); 62 auto model = Akonadi2::Store::loadModel<Akonadi2::ApplicationDomain::Mail>(query);
61 model->fetchMore(QModelIndex()); 63 model->fetchMore(QModelIndex());
62 QTRY_COMPARE(model->rowCount(), 1); 64 QTRY_COMPARE(model->rowCount(), 1);
@@ -75,10 +77,14 @@ private Q_SLOTS:
75 query.resources << "org.kde.dummy.instance1"; 77 query.resources << "org.kde.dummy.instance1";
76 query.syncOnDemand = false; 78 query.syncOnDemand = false;
77 query.processAll = true; 79 query.processAll = true;
78 query.liveQuery = true; 80 query.liveQuery = false;
79 81
82 //We fetch after the data is available and don't rely on the live query mechanism to deliver the actual data
80 auto model = Akonadi2::Store::loadModel<Akonadi2::ApplicationDomain::Mail>(query); 83 auto model = Akonadi2::Store::loadModel<Akonadi2::ApplicationDomain::Mail>(query);
81 QTest::qWait(200); 84
85 //Ensure all local data is processed
86 Akonadi2::Store::synchronize(query).exec().waitForFinished();
87
82 model->fetchMore(QModelIndex()); 88 model->fetchMore(QModelIndex());
83 QVERIFY(model->rowCount() < 2); 89 QVERIFY(model->rowCount() < 2);
84 QTRY_COMPARE(model->rowCount(), 1); 90 QTRY_COMPARE(model->rowCount(), 1);