diff options
Diffstat (limited to 'tests/querytest.cpp')
-rw-r--r-- | tests/querytest.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/querytest.cpp b/tests/querytest.cpp index 3b62f56..6279fa9 100644 --- a/tests/querytest.cpp +++ b/tests/querytest.cpp | |||
@@ -263,7 +263,6 @@ private slots: | |||
263 | query.resourceFilter("sink.dummy.instance1"); | 263 | query.resourceFilter("sink.dummy.instance1"); |
264 | query.requestTree<Folder::Parent>(); | 264 | query.requestTree<Folder::Parent>(); |
265 | 265 | ||
266 | // We fetch after the data is available and don't rely on the live query mechanism to deliver the actual data | ||
267 | auto model = Sink::Store::loadModel<Folder>(query); | 266 | auto model = Sink::Store::loadModel<Folder>(query); |
268 | QTRY_VERIFY(model->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool()); | 267 | QTRY_VERIFY(model->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool()); |
269 | QCOMPARE(model->rowCount(), 1); | 268 | QCOMPARE(model->rowCount(), 1); |
@@ -274,9 +273,15 @@ private slots: | |||
274 | VERIFYEXEC(Sink::Store::create<Folder>(subfolder)); | 273 | VERIFYEXEC(Sink::Store::create<Folder>(subfolder)); |
275 | VERIFYEXEC(Sink::ResourceControl::flushMessageQueue("sink.dummy.instance1")); | 274 | VERIFYEXEC(Sink::ResourceControl::flushMessageQueue("sink.dummy.instance1")); |
276 | 275 | ||
276 | //Ensure the folder appears | ||
277 | model->fetchMore(model->index(0, 0)); | 277 | model->fetchMore(model->index(0, 0)); |
278 | QTRY_VERIFY(model->data(model->index(0, 0), Sink::Store::ChildrenFetchedRole).toBool()); | 278 | QTRY_VERIFY(model->data(model->index(0, 0), Sink::Store::ChildrenFetchedRole).toBool()); |
279 | QCOMPARE(model->rowCount(model->index(0, 0)), 1); | 279 | QCOMPARE(model->rowCount(model->index(0, 0)), 1); |
280 | |||
281 | //...and dissapears again after removal | ||
282 | VERIFYEXEC(Sink::Store::remove<Folder>(subfolder)); | ||
283 | VERIFYEXEC(Sink::ResourceControl::flushMessageQueue("sink.dummy.instance1")); | ||
284 | QTRY_COMPARE(model->rowCount(model->index(0, 0)), 0); | ||
280 | } | 285 | } |
281 | 286 | ||
282 | void testMailByMessageId() | 287 | void testMailByMessageId() |