diff options
Diffstat (limited to 'tests/pipelinetest.cpp')
-rw-r--r-- | tests/pipelinetest.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/pipelinetest.cpp b/tests/pipelinetest.cpp index 6ea2041..6cb327f 100644 --- a/tests/pipelinetest.cpp +++ b/tests/pipelinetest.cpp | |||
@@ -34,6 +34,9 @@ static QList<QByteArray> getKeys(const QByteArray &dbEnv, const QByteArray &name | |||
34 | auto db = transaction.openDatabase(name, nullptr, false); | 34 | auto db = transaction.openDatabase(name, nullptr, false); |
35 | QList<QByteArray> result; | 35 | QList<QByteArray> result; |
36 | db.scan("", [&](const QByteArray &key, const QByteArray &value) { | 36 | db.scan("", [&](const QByteArray &key, const QByteArray &value) { |
37 | if (Sink::Storage::isInternalKey(key)) { | ||
38 | return true; | ||
39 | } | ||
37 | result << key; | 40 | result << key; |
38 | return true; | 41 | return true; |
39 | }); | 42 | }); |
@@ -106,13 +109,18 @@ QByteArray modifyEntityCommand(const flatbuffers::FlatBufferBuilder &entityFbb, | |||
106 | flatbuffers::FlatBufferBuilder fbb; | 109 | flatbuffers::FlatBufferBuilder fbb; |
107 | auto type = fbb.CreateString(Sink::ApplicationDomain::getTypeName<Sink::ApplicationDomain::Event>().toStdString().data()); | 110 | auto type = fbb.CreateString(Sink::ApplicationDomain::getTypeName<Sink::ApplicationDomain::Event>().toStdString().data()); |
108 | auto id = fbb.CreateString(std::string(uid.constData(), uid.size())); | 111 | auto id = fbb.CreateString(std::string(uid.constData(), uid.size())); |
112 | auto summaryProperty = fbb.CreateString("summary"); | ||
113 | std::vector<flatbuffers::Offset<flatbuffers::String>> modified; | ||
114 | modified.push_back(summaryProperty); | ||
109 | auto delta = fbb.CreateVector<uint8_t>(entityFbb.GetBufferPointer(), entityFbb.GetSize()); | 115 | auto delta = fbb.CreateVector<uint8_t>(entityFbb.GetBufferPointer(), entityFbb.GetSize()); |
116 | auto modifiedProperties = fbb.CreateVector(modified); | ||
110 | // auto delta = Sink::EntityBuffer::appendAsVector(fbb, buffer.constData(), buffer.size()); | 117 | // auto delta = Sink::EntityBuffer::appendAsVector(fbb, buffer.constData(), buffer.size()); |
111 | Sink::Commands::ModifyEntityBuilder builder(fbb); | 118 | Sink::Commands::ModifyEntityBuilder builder(fbb); |
112 | builder.add_domainType(type); | 119 | builder.add_domainType(type); |
113 | builder.add_delta(delta); | 120 | builder.add_delta(delta); |
114 | builder.add_revision(revision); | 121 | builder.add_revision(revision); |
115 | builder.add_entityId(id); | 122 | builder.add_entityId(id); |
123 | builder.add_modifiedProperties(modifiedProperties); | ||
116 | auto location = builder.Finish(); | 124 | auto location = builder.Finish(); |
117 | Sink::Commands::FinishModifyEntityBuffer(fbb, location); | 125 | Sink::Commands::FinishModifyEntityBuffer(fbb, location); |
118 | 126 | ||
@@ -207,6 +215,7 @@ private slots: | |||
207 | pipeline.commit(); | 215 | pipeline.commit(); |
208 | 216 | ||
209 | auto result = getKeys("org.kde.pipelinetest.instance1", "event.main"); | 217 | auto result = getKeys("org.kde.pipelinetest.instance1", "event.main"); |
218 | qDebug() << result; | ||
210 | QCOMPARE(result.size(), 1); | 219 | QCOMPARE(result.size(), 1); |
211 | } | 220 | } |
212 | 221 | ||
@@ -349,6 +358,7 @@ private slots: | |||
349 | pipeline.setResourceType("test"); | 358 | pipeline.setResourceType("test"); |
350 | pipeline.setPreprocessors("event", QVector<Sink::Preprocessor *>() << &testProcessor); | 359 | pipeline.setPreprocessors("event", QVector<Sink::Preprocessor *>() << &testProcessor); |
351 | pipeline.startTransaction(); | 360 | pipeline.startTransaction(); |
361 | // pipeline.setAdaptorFactory("event", QSharedPointer<TestEventAdaptorFactory>::create()); | ||
352 | 362 | ||
353 | // Actual test | 363 | // Actual test |
354 | { | 364 | { |