summaryrefslogtreecommitdiffstats
path: root/tests/storagetest.cpp
diff options
context:
space:
mode:
authorAaron Seigo <aseigo@kde.org>2014-12-06 00:39:07 +0100
committerAaron Seigo <aseigo@kde.org>2014-12-06 00:39:07 +0100
commit66bcbab0990c965196991d66ca2a595cf9135074 (patch)
tree3d592cd8c6369ebdb4407d564b01f31defd939cb /tests/storagetest.cpp
parent1a429fd3103c16899f1f7be25046bb63b2b314c3 (diff)
downloadsink-66bcbab0990c965196991d66ca2a595cf9135074.tar.gz
sink-66bcbab0990c965196991d66ca2a595cf9135074.zip
read takes an error handler rather than returns a bool
Diffstat (limited to 'tests/storagetest.cpp')
-rw-r--r--tests/storagetest.cpp16
1 files changed, 10 insertions, 6 deletions
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