diff options
Diffstat (limited to 'tests/storagetest.cpp')
-rw-r--r-- | tests/storagetest.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/storagetest.cpp b/tests/storagetest.cpp index bca91b1..40492f0 100644 --- a/tests/storagetest.cpp +++ b/tests/storagetest.cpp | |||
@@ -456,8 +456,10 @@ private slots: | |||
456 | auto db = transaction.openDatabase("test", nullptr, false); | 456 | auto db = transaction.openDatabase("test", nullptr, false); |
457 | const auto uid = "{c5d06a9f-1534-4c52-b8ea-415db68bdadf}"; | 457 | const auto uid = "{c5d06a9f-1534-4c52-b8ea-415db68bdadf}"; |
458 | //Ensure we can sort 1 and 10 properly (by default string comparison 10 comes before 6) | 458 | //Ensure we can sort 1 and 10 properly (by default string comparison 10 comes before 6) |
459 | db.write(Sink::Storage::DataStore::assembleKey(uid, 6), "value1"); | 459 | const auto key1 = Sink::Storage::Key(Sink::Storage::Identifier::fromDisplayByteArray(uid), 6); |
460 | db.write(Sink::Storage::DataStore::assembleKey(uid, 10), "value2"); | 460 | db.write(key1.toInternalByteArray(), "value1"); |
461 | const auto key2 = Sink::Storage::Key(Sink::Storage::Identifier::fromDisplayByteArray(uid), 10); | ||
462 | db.write(key2.toInternalByteArray(), "value2"); | ||
461 | db.findLatest(uid, [&](const QByteArray &key, const QByteArray &value) { result = value; }); | 463 | db.findLatest(uid, [&](const QByteArray &key, const QByteArray &value) { result = value; }); |
462 | QCOMPARE(result, QByteArray("value2")); | 464 | QCOMPARE(result, QByteArray("value2")); |
463 | } | 465 | } |
@@ -689,7 +691,7 @@ private slots: | |||
689 | Sink::Storage::DataStore::clearEnv(); | 691 | Sink::Storage::DataStore::clearEnv(); |
690 | 692 | ||
691 | //Try to read-only dynamic opening of the db. | 693 | //Try to read-only dynamic opening of the db. |
692 | //This is the case if we don't have all databases available upon initializatoin and we don't (e.g. because the db hasn't been created yet) | 694 | //This is the case if we don't have all databases available upon initializatoin and we don't (e.g. because the db hasn't been created yet) |
693 | { | 695 | { |
694 | // Trick the db into not loading all dbs by passing in a bogus layout. | 696 | // Trick the db into not loading all dbs by passing in a bogus layout. |
695 | Sink::Storage::DataStore store(testDataPath, {dbName, {{"bogus", 0}}}, Sink::Storage::DataStore::ReadOnly); | 697 | Sink::Storage::DataStore store(testDataPath, {dbName, {{"bogus", 0}}}, Sink::Storage::DataStore::ReadOnly); |
@@ -707,7 +709,7 @@ private slots: | |||
707 | 709 | ||
708 | Sink::Storage::DataStore::clearEnv(); | 710 | Sink::Storage::DataStore::clearEnv(); |
709 | //Try to read-write dynamic opening of the db. | 711 | //Try to read-write dynamic opening of the db. |
710 | //This is the case if we don't have all databases available upon initializatoin and we don't (e.g. because the db hasn't been created yet) | 712 | //This is the case if we don't have all databases available upon initializatoin and we don't (e.g. because the db hasn't been created yet) |
711 | { | 713 | { |
712 | // Trick the db into not loading all dbs by passing in a bogus layout. | 714 | // Trick the db into not loading all dbs by passing in a bogus layout. |
713 | Sink::Storage::DataStore store(testDataPath, {dbName, {{"bogus", 0}}}, Sink::Storage::DataStore::ReadWrite); | 715 | Sink::Storage::DataStore store(testDataPath, {dbName, {{"bogus", 0}}}, Sink::Storage::DataStore::ReadWrite); |