diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-11-13 23:31:41 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-11-13 23:31:41 +0100 |
commit | 75c231f0758603120ec562af772b48b5f6ac0e24 (patch) | |
tree | 39abf8f038bd379ee3c0640a7476e6129ed71f8c /tests/querytest.cpp | |
parent | 09aafbd1373b5d1152ac7a453a140a7f76c2e90e (diff) | |
download | sink-75c231f0758603120ec562af772b48b5f6ac0e24.tar.gz sink-75c231f0758603120ec562af772b48b5f6ac0e24.zip |
DummyResourceTest and QueryTest are passing
sync has been removed from the query code and is now a separate step
Diffstat (limited to 'tests/querytest.cpp')
-rw-r--r-- | tests/querytest.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/tests/querytest.cpp b/tests/querytest.cpp index 9f4b3bb..47d977b 100644 --- a/tests/querytest.cpp +++ b/tests/querytest.cpp | |||
@@ -57,11 +57,33 @@ private Q_SLOTS: | |||
57 | query.syncOnDemand = false; | 57 | query.syncOnDemand = false; |
58 | query.processAll = true; | 58 | query.processAll = true; |
59 | 59 | ||
60 | auto model = new ModelResult<Akonadi2::ApplicationDomain::Mail>(query, QList<QByteArray>() << "summary" << "uid"); | 60 | auto model = Akonadi2::Store::loadModel<Akonadi2::ApplicationDomain::Mail>(query); |
61 | model->fetchMore(QModelIndex()); | 61 | model->fetchMore(QModelIndex()); |
62 | QTRY_COMPARE(model->rowCount(), 1); | 62 | QTRY_COMPARE(model->rowCount(), 1); |
63 | } | 63 | } |
64 | 64 | ||
65 | void testSingleWithDelay() | ||
66 | { | ||
67 | //Setup | ||
68 | { | ||
69 | Akonadi2::ApplicationDomain::Mail mail("org.kde.dummy.instance1"); | ||
70 | Akonadi2::Store::create<Akonadi2::ApplicationDomain::Mail>(mail).exec().waitForFinished(); | ||
71 | } | ||
72 | |||
73 | //Test | ||
74 | Akonadi2::Query query; | ||
75 | query.resources << "org.kde.dummy.instance1"; | ||
76 | query.syncOnDemand = false; | ||
77 | query.processAll = true; | ||
78 | query.liveQuery = true; | ||
79 | |||
80 | auto model = Akonadi2::Store::loadModel<Akonadi2::ApplicationDomain::Mail>(query); | ||
81 | QTest::qWait(200); | ||
82 | model->fetchMore(QModelIndex()); | ||
83 | QVERIFY(model->rowCount() < 2); | ||
84 | QTRY_COMPARE(model->rowCount(), 1); | ||
85 | } | ||
86 | |||
65 | // void testTree() | 87 | // void testTree() |
66 | // { | 88 | // { |
67 | // //Setup | 89 | // //Setup |