diff options
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 |