summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/storagebenchmark.cpp2
-rw-r--r--tests/storagetest.cpp16
2 files changed, 11 insertions, 7 deletions
diff --git a/tests/storagebenchmark.cpp b/tests/storagebenchmark.cpp
index 6010539..9c95d3b 100644
--- a/tests/storagebenchmark.cpp
+++ b/tests/storagebenchmark.cpp
@@ -118,7 +118,7 @@ private Q_SLOTS:
118 { 118 {
119 for (int i = 0; i < count; i++) { 119 for (int i = 0; i < count; i++) {
120 if (store) { 120 if (store) {
121 store->read(keyPrefix + std::to_string(i), [](std::string value){}); 121 store->read(keyPrefix + std::to_string(i), [](std::string value) -> bool { return true; });
122 } 122 }
123 } 123 }
124 } 124 }
diff --git a/tests/storagetest.cpp b/tests/storagetest.cpp
index 3981c4b..1974355 100644
--- a/tests/storagetest.cpp
+++ b/tests/storagetest.cpp
@@ -38,12 +38,16 @@ private:
38 bool success = true; 38 bool success = true;
39 bool keyMatch = true; 39 bool keyMatch = true;
40 const auto reference = keyPrefix + std::to_string(i); 40 const auto reference = keyPrefix + std::to_string(i);
41 success = storage.read(keyPrefix + std::to_string(i), [&keyMatch, &reference](const std::string &value) { 41 storage.read(keyPrefix + std::to_string(i),
42 if (value != reference) { 42 [&keyMatch, &reference](const std::string &value) -> bool {
43 qDebug() << "Mismatch while reading"; 43 if (value != reference) {
44 keyMatch = false; 44 qDebug() << "Mismatch while reading";
45 } 45 keyMatch = false;
46 }); 46 }
47 return keyMatch;
48 },
49 [&success](const Storage::Error &) { success = false; }
50 );
47 return success && keyMatch; 51 return success && keyMatch;
48 } 52 }
49 53