From 33d131ee7c673cdddf5583d99f7101aaf9de301c Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Mon, 2 Jul 2018 14:38:28 +0200 Subject: A little extra testing --- tests/querytest.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/querytest.cpp b/tests/querytest.cpp index f320d57..5abe6d0 100644 --- a/tests/querytest.cpp +++ b/tests/querytest.cpp @@ -1027,7 +1027,7 @@ private slots: query.setId("testFilteredReductionUpdate"); query.setFlags(Query::LiveQuery); query.filter(folder1); - query.reduce(Query::Reduce::Selector::max()); + query.reduce(Query::Reduce::Selector::max()).count("count"); auto model = Sink::Store::loadModel(query); QTRY_VERIFY(model->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool()); @@ -1053,6 +1053,17 @@ private slots: } VERIFYEXEC(Sink::ResourceControl::flushMessageQueue("sink.dummy.instance1")); QTRY_COMPARE(model->rowCount(), 1); + QCOMPARE(model->data(model->index(0, 0, QModelIndex{}), Sink::Store::DomainObjectRole).value()->getProperty("count").toInt(), 1); + + //Ensure another entity still results in a modification + { + auto mail = Mail::createEntity("sink.dummy.instance1"); + mail.setExtractedMessageId("aggregatedId"); + mail.setFolder(folder1); + VERIFYEXEC(Sink::Store::create(mail)); + } + VERIFYEXEC(Sink::ResourceControl::flushMessageQueue("sink.dummy.instance1")); + QTRY_COMPARE(model->data(model->index(0, 0, QModelIndex{}), Sink::Store::DomainObjectRole).value()->getProperty("count").toInt(), 2); } void testBloom() -- cgit v1.2.3