diff options
Diffstat (limited to 'tests/pipelinetest.cpp')
-rw-r--r-- | tests/pipelinetest.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/tests/pipelinetest.cpp b/tests/pipelinetest.cpp index 5165d35..2610305 100644 --- a/tests/pipelinetest.cpp +++ b/tests/pipelinetest.cpp | |||
@@ -22,6 +22,8 @@ | |||
22 | #include "adaptorfactoryregistry.h" | 22 | #include "adaptorfactoryregistry.h" |
23 | #include "storage/key.h" | 23 | #include "storage/key.h" |
24 | 24 | ||
25 | // TODO: fix test | ||
26 | |||
25 | static void removeFromDisk(const QString &name) | 27 | static void removeFromDisk(const QString &name) |
26 | { | 28 | { |
27 | Sink::Storage::DataStore store(Sink::Store::storageLocation(), name, Sink::Storage::DataStore::ReadWrite); | 29 | Sink::Storage::DataStore store(Sink::Store::storageLocation(), name, Sink::Storage::DataStore::ReadWrite); |
@@ -379,8 +381,7 @@ private slots: | |||
379 | pipeline.newEntity(command.constData(), command.size()); | 381 | pipeline.newEntity(command.constData(), command.size()); |
380 | QCOMPARE(testProcessor->newUids.size(), 1); | 382 | QCOMPARE(testProcessor->newUids.size(), 1); |
381 | QCOMPARE(testProcessor->newRevisions.size(), 1); | 383 | QCOMPARE(testProcessor->newRevisions.size(), 1); |
382 | // Key doesn't contain revision and is just the uid | 384 | const auto uid = Sink::Storage::Identifier::fromDisplayByteArray(testProcessor->newUids.at(0)).toDisplayByteArray(); |
383 | const auto uid = Sink::Storage::Key::fromDisplayByteArray(testProcessor->newUids.at(0)).identifier().toDisplayByteArray(); | ||
384 | QCOMPARE(testProcessor->newUids.at(0), uid); | 385 | QCOMPARE(testProcessor->newUids.at(0), uid); |
385 | } | 386 | } |
386 | pipeline.commit(); | 387 | pipeline.commit(); |
@@ -388,14 +389,13 @@ private slots: | |||
388 | pipeline.startTransaction(); | 389 | pipeline.startTransaction(); |
389 | auto keys = getKeys(instanceIdentifier(), "event.main"); | 390 | auto keys = getKeys(instanceIdentifier(), "event.main"); |
390 | QCOMPARE(keys.size(), 1); | 391 | QCOMPARE(keys.size(), 1); |
391 | const auto uid = Sink::Storage::Key::fromDisplayByteArray(keys.first()).identifier().toDisplayByteArray(); | 392 | const auto uid = Sink::Storage::Key::fromInternalByteArray(keys.first()).identifier().toDisplayByteArray(); |
392 | { | 393 | { |
393 | auto modifyCommand = modifyEntityCommand(createEvent(entityFbb, "summary2"), uid, 1); | 394 | auto modifyCommand = modifyEntityCommand(createEvent(entityFbb, "summary2"), uid, 1); |
394 | pipeline.modifiedEntity(modifyCommand.constData(), modifyCommand.size()); | 395 | pipeline.modifiedEntity(modifyCommand.constData(), modifyCommand.size()); |
395 | QCOMPARE(testProcessor->modifiedUids.size(), 1); | 396 | QCOMPARE(testProcessor->modifiedUids.size(), 1); |
396 | QCOMPARE(testProcessor->modifiedRevisions.size(), 1); | 397 | QCOMPARE(testProcessor->modifiedRevisions.size(), 1); |
397 | // Key doesn't contain revision and is just the uid | 398 | const auto uid2 = Sink::Storage::Identifier::fromDisplayByteArray(testProcessor->modifiedUids.at(0)).toDisplayByteArray(); |
398 | const auto uid2 = Sink::Storage::Key::fromDisplayByteArray(testProcessor->modifiedUids.at(0)).identifier().toDisplayByteArray(); | ||
399 | QCOMPARE(testProcessor->modifiedUids.at(0), uid2); | 399 | QCOMPARE(testProcessor->modifiedUids.at(0), uid2); |
400 | } | 400 | } |
401 | pipeline.commit(); | 401 | pipeline.commit(); |
@@ -407,8 +407,7 @@ private slots: | |||
407 | QCOMPARE(testProcessor->deletedUids.size(), 1); | 407 | QCOMPARE(testProcessor->deletedUids.size(), 1); |
408 | QCOMPARE(testProcessor->deletedUids.size(), 1); | 408 | QCOMPARE(testProcessor->deletedUids.size(), 1); |
409 | QCOMPARE(testProcessor->deletedSummaries.size(), 1); | 409 | QCOMPARE(testProcessor->deletedSummaries.size(), 1); |
410 | // Key doesn't contain revision and is just the uid | 410 | const auto uid2 = Sink::Storage::Identifier::fromDisplayByteArray(testProcessor->modifiedUids.at(0)).toDisplayByteArray(); |
411 | const auto uid2 = Sink::Storage::Key::fromDisplayByteArray(testProcessor->modifiedUids.at(0)).identifier().toDisplayByteArray(); | ||
412 | QCOMPARE(testProcessor->deletedUids.at(0), uid2); | 411 | QCOMPARE(testProcessor->deletedUids.at(0), uid2); |
413 | QCOMPARE(testProcessor->deletedSummaries.at(0), QByteArray("summary2")); | 412 | QCOMPARE(testProcessor->deletedSummaries.at(0), QByteArray("summary2")); |
414 | } | 413 | } |