diff options
Diffstat (limited to 'tests/storagetest.cpp')
-rw-r--r-- | tests/storagetest.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/storagetest.cpp b/tests/storagetest.cpp index d3f180a..2ddbebf 100644 --- a/tests/storagetest.cpp +++ b/tests/storagetest.cpp | |||
@@ -457,10 +457,11 @@ private slots: | |||
457 | auto db = transaction.openDatabase("test", nullptr, false); | 457 | auto db = transaction.openDatabase("test", nullptr, false); |
458 | const auto uid = "{c5d06a9f-1534-4c52-b8ea-415db68bdadf}"; | 458 | const auto uid = "{c5d06a9f-1534-4c52-b8ea-415db68bdadf}"; |
459 | //Ensure we can sort 1 and 10 properly (by default string comparison 10 comes before 6) | 459 | //Ensure we can sort 1 and 10 properly (by default string comparison 10 comes before 6) |
460 | const auto key1 = Sink::Storage::Key(Sink::Storage::Identifier::fromDisplayByteArray(uid), 6); | 460 | const auto id = Sink::Storage::Identifier::fromDisplayByteArray(uid); |
461 | db.write(key1.toInternalByteArray(), "value1"); | 461 | auto key = Sink::Storage::Key(id, 6); |
462 | const auto key2 = Sink::Storage::Key(Sink::Storage::Identifier::fromDisplayByteArray(uid), 10); | 462 | db.write(key.toInternalByteArray(), "value1"); |
463 | db.write(key2.toInternalByteArray(), "value2"); | 463 | key.setRevision(10); |
464 | db.write(key.toInternalByteArray(), "value2"); | ||
464 | db.findLatest(uid, [&](const QByteArray &key, const QByteArray &value) { result = value; }); | 465 | db.findLatest(uid, [&](const QByteArray &key, const QByteArray &value) { result = value; }); |
465 | QCOMPARE(result, QByteArray("value2")); | 466 | QCOMPARE(result, QByteArray("value2")); |
466 | } | 467 | } |