diff options
Diffstat (limited to 'tests/storagetest.cpp')
-rw-r--r-- | tests/storagetest.cpp | 16 |
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 | ||