diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-12-10 16:40:27 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-12-10 16:40:27 +0100 |
commit | f2f26869ed6efc4faf173b9a5cd5d2f15cec1e06 (patch) | |
tree | 528f4dc70303424120c1f38a5ba2bc1f2592e55c /tests/querytest.cpp | |
parent | 8dfbfdddfec1bfe0e7db6c4752fcecf3293e292a (diff) | |
download | sink-f2f26869ed6efc4faf173b9a5cd5d2f15cec1e06.tar.gz sink-f2f26869ed6efc4faf173b9a5cd5d2f15cec1e06.zip |
Deal with no available resources
Diffstat (limited to 'tests/querytest.cpp')
-rw-r--r-- | tests/querytest.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/querytest.cpp b/tests/querytest.cpp index f0f0766..1192b87 100644 --- a/tests/querytest.cpp +++ b/tests/querytest.cpp | |||
@@ -43,6 +43,22 @@ private Q_SLOTS: | |||
43 | qDebug(); | 43 | qDebug(); |
44 | } | 44 | } |
45 | 45 | ||
46 | void testNoResources() | ||
47 | { | ||
48 | //Test | ||
49 | Akonadi2::Query query; | ||
50 | query.resources << "foobar"; | ||
51 | query.syncOnDemand = false; | ||
52 | query.processAll = false; | ||
53 | query.liveQuery = true; | ||
54 | |||
55 | //We fetch before the data is available and rely on the live query mechanism to deliver the actual data | ||
56 | auto model = Akonadi2::Store::loadModel<Akonadi2::ApplicationDomain::Mail>(query); | ||
57 | QTRY_VERIFY(model->data(QModelIndex(), Akonadi2::Store::ChildrenFetchedRole).toBool()); | ||
58 | QCOMPARE(model->rowCount(), 0); | ||
59 | } | ||
60 | |||
61 | |||
46 | void testSingle() | 62 | void testSingle() |
47 | { | 63 | { |
48 | //Setup | 64 | //Setup |