diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-10-06 17:52:52 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-10-06 17:52:52 +0200 |
commit | 87695f52d5ac627cdd710f37c275fccdf920af0b (patch) | |
tree | 733a7e66fafd3a0ae747b050427f2d7762bde793 /tests/mailthreadtest.cpp | |
parent | f1e496f7c12ebc787ed47a4c048015f2098e65d9 (diff) | |
download | sink-87695f52d5ac627cdd710f37c275fccdf920af0b.tar.gz sink-87695f52d5ac627cdd710f37c275fccdf920af0b.zip |
count as a first aggregation function
Diffstat (limited to 'tests/mailthreadtest.cpp')
-rw-r--r-- | tests/mailthreadtest.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/mailthreadtest.cpp b/tests/mailthreadtest.cpp index 9e5e911..917e3e2 100644 --- a/tests/mailthreadtest.cpp +++ b/tests/mailthreadtest.cpp | |||
@@ -70,7 +70,7 @@ void MailThreadTest::testListThreadLeader() | |||
70 | query.resourceFilter(mResourceInstanceIdentifier); | 70 | query.resourceFilter(mResourceInstanceIdentifier); |
71 | query.request<Mail::Subject>().request<Mail::MimeMessage>().request<Mail::Folder>().request<Mail::Date>(); | 71 | query.request<Mail::Subject>().request<Mail::MimeMessage>().request<Mail::Folder>().request<Mail::Date>(); |
72 | query.sort<Mail::Date>(); | 72 | query.sort<Mail::Date>(); |
73 | query.reduce<Mail::ThreadId>(Query::Reduce::Selector::max<Mail::Date>()); | 73 | query.reduce<Mail::ThreadId>(Query::Reduce::Selector::max<Mail::Date>()).count("count").collect<Mail::Sender>("senders"); |
74 | 74 | ||
75 | // Ensure all local data is processed | 75 | // Ensure all local data is processed |
76 | VERIFYEXEC(Store::synchronize(query)); | 76 | VERIFYEXEC(Store::synchronize(query)); |
@@ -79,6 +79,8 @@ void MailThreadTest::testListThreadLeader() | |||
79 | auto mails = Store::read<Mail>(query); | 79 | auto mails = Store::read<Mail>(query); |
80 | QCOMPARE(mails.size(), 1); | 80 | QCOMPARE(mails.size(), 1); |
81 | QVERIFY(mails.first().getSubject().startsWith(QString("ThreadLeader"))); | 81 | QVERIFY(mails.first().getSubject().startsWith(QString("ThreadLeader"))); |
82 | auto threadSize = mails.first().getProperty("count").toInt(); | ||
83 | QCOMPARE(threadSize, 2); | ||
82 | } | 84 | } |
83 | 85 | ||
84 | /* | 86 | /* |