summaryrefslogtreecommitdiffstats
path: root/tests/mailquerybenchmark.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-03-19 19:15:16 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-03-19 19:15:16 +0100
commiteb6c96a4b483eae98fe9fc897761dccde68b0925 (patch)
tree6313f7cfaf04e4ffbc98d0840f1daa60afb0925a /tests/mailquerybenchmark.cpp
parenta16ae6c64b75706f9663fb27510a73d1a6a29de8 (diff)
downloadsink-eb6c96a4b483eae98fe9fc897761dccde68b0925.tar.gz
sink-eb6c96a4b483eae98fe9fc897761dccde68b0925.zip
Fixed mailquery benchmark.
Diffstat (limited to 'tests/mailquerybenchmark.cpp')
-rw-r--r--tests/mailquerybenchmark.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/mailquerybenchmark.cpp b/tests/mailquerybenchmark.cpp
index 022d21d..3ecfa19 100644
--- a/tests/mailquerybenchmark.cpp
+++ b/tests/mailquerybenchmark.cpp
@@ -69,7 +69,7 @@ class MailQueryBenchmark : public QObject
69 if (folderSpreadFactor == 0) { 69 if (folderSpreadFactor == 0) {
70 domainObject.setFolder("folder1"); 70 domainObject.setFolder("folder1");
71 } else { 71 } else {
72 domainObject.setFolder(QByteArray("folder") + QByteArray::number(i % folderSpreadFactor)); 72 domainObject.setFolder(QByteArray("folder") + QByteArray::number(i - (i % folderSpreadFactor)));
73 } 73 }
74 74
75 entityStore.add("mail", domainObject, false, [] (const Mail &) {}); 75 entityStore.add("mail", domainObject, false, [] (const Mail &) {});
@@ -172,9 +172,11 @@ private slots:
172 query.reduce<ApplicationDomain::Mail::Folder>(Query::Reduce::Selector::max<ApplicationDomain::Mail::Date>()); 172 query.reduce<ApplicationDomain::Mail::Folder>(Query::Reduce::Selector::max<ApplicationDomain::Mail::Date>());
173 query.limit(1000); 173 query.limit(1000);
174 174
175 int mailsPerFolder = 100; 175 int mailsPerFolder = 10;
176 populateDatabase(50000, mailsPerFolder); 176
177 testLoad(query, 50000, mailsPerFolder); 177 int count = 50000;
178 populateDatabase(count, mailsPerFolder);
179 testLoad(query, count, query.limit());
178 } 180 }
179}; 181};
180 182