summaryrefslogtreecommitdiffstats
path: root/tests/pipelinetest.cpp
diff options
context:
space:
mode:
authorMinijackson <minijackson@riseup.net>2018-06-26 14:10:30 +0200
committerMinijackson <minijackson@riseup.net>2018-07-04 15:37:14 +0200
commitc90ba4a98292a39eb0b3df12fd7e2dec0300e58d (patch)
tree0c0c252087e6d8ccf31ba521ea76a7153032f20d /tests/pipelinetest.cpp
parent922e0979e2c27ff8dbc765ae151d17c7815b98a0 (diff)
downloadsink-c90ba4a98292a39eb0b3df12fd7e2dec0300e58d.tar.gz
sink-c90ba4a98292a39eb0b3df12fd7e2dec0300e58d.zip
Move Key API into own files + some fixes
Diffstat (limited to 'tests/pipelinetest.cpp')
-rw-r--r--tests/pipelinetest.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/pipelinetest.cpp b/tests/pipelinetest.cpp
index 7431deb..5165d35 100644
--- a/tests/pipelinetest.cpp
+++ b/tests/pipelinetest.cpp
@@ -20,6 +20,7 @@
20#include "domainadaptor.h" 20#include "domainadaptor.h"
21#include "definitions.h" 21#include "definitions.h"
22#include "adaptorfactoryregistry.h" 22#include "adaptorfactoryregistry.h"
23#include "storage/key.h"
23 24
24static void removeFromDisk(const QString &name) 25static void removeFromDisk(const QString &name)
25{ 26{
@@ -430,8 +431,8 @@ private slots:
430 // Get uid of written entity 431 // Get uid of written entity
431 auto keys = getKeys(instanceIdentifier(), "event.main"); 432 auto keys = getKeys(instanceIdentifier(), "event.main");
432 QCOMPARE(keys.size(), 1); 433 QCOMPARE(keys.size(), 1);
433 const auto key = keys.first(); 434 auto key = Sink::Storage::Key::fromInternalByteArray(keys.first());
434 const auto uid = Sink::Storage::DataStore::uidFromKey(key); 435 const auto uid = key.identifier().toDisplayByteArray();
435 436
436 //Simulate local modification 437 //Simulate local modification
437 { 438 {
@@ -453,8 +454,10 @@ private slots:
453 pipeline.commit(); 454 pipeline.commit();
454 } 455 }
455 456
457 key.setRevision(3);
458
456 // Ensure we've got the new revision with the modification 459 // Ensure we've got the new revision with the modification
457 auto buffer = getEntity(instanceIdentifier(), "event.main", Sink::Storage::DataStore::assembleKey(uid, 3)); 460 auto buffer = getEntity(instanceIdentifier(), "event.main", key.toInternalByteArray());
458 QVERIFY(!buffer.isEmpty()); 461 QVERIFY(!buffer.isEmpty());
459 Sink::EntityBuffer entityBuffer(buffer.data(), buffer.size()); 462 Sink::EntityBuffer entityBuffer(buffer.data(), buffer.size());
460 auto adaptor = adaptorFactory->createAdaptor(entityBuffer.entity()); 463 auto adaptor = adaptorFactory->createAdaptor(entityBuffer.entity());