From f2f26869ed6efc4faf173b9a5cd5d2f15cec1e06 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Thu, 10 Dec 2015 16:40:27 +0100 Subject: Deal with no available resources --- tests/querytest.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tests') 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: qDebug(); } + void testNoResources() + { + //Test + Akonadi2::Query query; + query.resources << "foobar"; + query.syncOnDemand = false; + 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); + QTRY_VERIFY(model->data(QModelIndex(), Akonadi2::Store::ChildrenFetchedRole).toBool()); + QCOMPARE(model->rowCount(), 0); + } + + void testSingle() { //Setup -- cgit v1.2.3