From cc3fed3668a80616ec78bc872e21b7ac06bcde38 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Thu, 9 Apr 2015 15:21:06 +0200 Subject: Renamed Akonadi::Domain to Akonadi::ApplicationDomain Because it's really the application domain and not the akonadi domain. --- tests/domainadaptortest.cpp | 36 ++++++++++++++++++------------------ tests/dummyresourcebenchmark.cpp | 10 +++++----- tests/dummyresourcetest.cpp | 20 ++++++++++---------- 3 files changed, 33 insertions(+), 33 deletions(-) (limited to 'tests') diff --git a/tests/domainadaptortest.cpp b/tests/domainadaptortest.cpp index e45a9a3..9cc3938 100644 --- a/tests/domainadaptortest.cpp +++ b/tests/domainadaptortest.cpp @@ -13,11 +13,11 @@ #include "metadata_generated.h" #include "entity_generated.h" -class TestEventAdaptor : public Akonadi2::Domain::BufferAdaptor +class TestEventAdaptor : public Akonadi2::ApplicationDomain::BufferAdaptor { public: TestEventAdaptor() - : Akonadi2::Domain::BufferAdaptor() + : Akonadi2::ApplicationDomain::BufferAdaptor() { } @@ -40,20 +40,20 @@ public: return QVariant(); } - Akonadi2::Domain::Buffer::Event const *mLocalBuffer; - Akonadi2::Domain::Buffer::Event const *mResourceBuffer; + Akonadi2::ApplicationDomain::Buffer::Event const *mLocalBuffer; + Akonadi2::ApplicationDomain::Buffer::Event const *mResourceBuffer; - QSharedPointer > mLocalMapper; - QSharedPointer > mResourceMapper; + QSharedPointer > mLocalMapper; + QSharedPointer > mResourceMapper; }; -class TestFactory : public DomainTypeAdaptorFactory +class TestFactory : public DomainTypeAdaptorFactory { public: TestFactory() { - mResourceMapper = QSharedPointer >::create(); - mResourceMapper->mReadAccessors.insert("summary", [](Akonadi2::Domain::Buffer::Event const *buffer) -> QVariant { + mResourceMapper = QSharedPointer >::create(); + mResourceMapper->mReadAccessors.insert("summary", [](Akonadi2::ApplicationDomain::Buffer::Event const *buffer) -> QVariant { if (buffer->summary()) { return QString::fromStdString(buffer->summary()->c_str()); } @@ -61,13 +61,13 @@ public: }); } - virtual QSharedPointer createAdaptor(const Akonadi2::Entity &entity) + virtual QSharedPointer createAdaptor(const Akonadi2::Entity &entity) { - Akonadi2::Domain::Buffer::Event const *resourceBuffer = 0; + Akonadi2::ApplicationDomain::Buffer::Event const *resourceBuffer = 0; if (auto resourceData = entity.resource()) { flatbuffers::Verifier verifyer(resourceData->Data(), resourceData->size()); - if (Akonadi2::Domain::Buffer::VerifyEventBuffer(verifyer)) { - resourceBuffer = Akonadi2::Domain::Buffer::GetEvent(resourceData->Data()); + if (Akonadi2::ApplicationDomain::Buffer::VerifyEventBuffer(verifyer)) { + resourceBuffer = Akonadi2::ApplicationDomain::Buffer::GetEvent(resourceData->Data()); if (resourceBuffer->summary()) { qDebug() << QString::fromStdString(std::string(resourceBuffer->summary()->c_str())); } @@ -82,11 +82,11 @@ public: // } // } - Akonadi2::Domain::Buffer::Event const *localBuffer = 0; + Akonadi2::ApplicationDomain::Buffer::Event const *localBuffer = 0; if (auto localData = entity.local()) { flatbuffers::Verifier verifyer(localData->Data(), localData->size()); - if (Akonadi2::Domain::Buffer::VerifyEventBuffer(verifyer)) { - localBuffer = Akonadi2::Domain::Buffer::GetEvent(localData); + if (Akonadi2::ApplicationDomain::Buffer::VerifyEventBuffer(verifyer)) { + localBuffer = Akonadi2::ApplicationDomain::Buffer::GetEvent(localData); } } @@ -127,12 +127,12 @@ private Q_SLOTS: static uint8_t rawData[100]; auto attachment = m_fbb.CreateVector(rawData, 100); - auto builder = Akonadi2::Domain::Buffer::EventBuilder(m_fbb); + auto builder = Akonadi2::ApplicationDomain::Buffer::EventBuilder(m_fbb); builder.add_summary(summary); builder.add_description(description); builder.add_attachment(attachment); auto buffer = builder.Finish(); - Akonadi2::Domain::Buffer::FinishEventBuffer(m_fbb, buffer); + Akonadi2::ApplicationDomain::Buffer::FinishEventBuffer(m_fbb, buffer); flatbuffers::FlatBufferBuilder fbb; Akonadi2::EntityBuffer::assembleEntityBuffer(fbb, metadataFbb.GetBufferPointer(), metadataFbb.GetSize(), m_fbb.GetBufferPointer(), m_fbb.GetSize(), m_fbb.GetBufferPointer(), m_fbb.GetSize()); diff --git a/tests/dummyresourcebenchmark.cpp b/tests/dummyresourcebenchmark.cpp index 308a4e8..ea3f556 100644 --- a/tests/dummyresourcebenchmark.cpp +++ b/tests/dummyresourcebenchmark.cpp @@ -47,11 +47,11 @@ private Q_SLOTS: time.start(); int num = 10000; for (int i = 0; i < num; i++) { - Akonadi2::Domain::Event event; + Akonadi2::ApplicationDomain::Event event; event.setProperty("uid", "testuid"); QCOMPARE(event.getProperty("uid").toByteArray(), QByteArray("testuid")); event.setProperty("summary", "summaryValue"); - Akonadi2::Store::create(event, "org.kde.dummy"); + Akonadi2::Store::create(event, "org.kde.dummy"); } auto appendTime = time.elapsed(); @@ -63,7 +63,7 @@ private Q_SLOTS: query.processAll = true; query.propertyFilter.insert("uid", "nonexistantuid"); - async::SyncListResult result(Akonadi2::Store::load(query)); + async::SyncListResult result(Akonadi2::Store::load(query)); result.exec(); } auto allProcessedTime = time.elapsed(); @@ -77,7 +77,7 @@ private Q_SLOTS: query.processAll = false; query.propertyFilter.insert("uid", "testuid"); - async::SyncListResult result(Akonadi2::Store::load(query)); + async::SyncListResult result(Akonadi2::Store::load(query)); result.exec(); QCOMPARE(result.size(), num); } @@ -146,7 +146,7 @@ private Q_SLOTS: } void testCreateCommand() { - Akonadi2::Domain::Event event; + Akonadi2::ApplicationDomain::Event event; QBENCHMARK { auto mFactory = new DummyEventAdaptorFactory; diff --git a/tests/dummyresourcetest.cpp b/tests/dummyresourcetest.cpp index b185664..5fed7cd 100644 --- a/tests/dummyresourcetest.cpp +++ b/tests/dummyresourcetest.cpp @@ -49,26 +49,26 @@ private Q_SLOTS: eventFbb.Clear(); { auto summary = eventFbb.CreateString("summary"); - Akonadi2::Domain::Buffer::EventBuilder eventBuilder(eventFbb); + Akonadi2::ApplicationDomain::Buffer::EventBuilder eventBuilder(eventFbb); eventBuilder.add_summary(summary); auto eventLocation = eventBuilder.Finish(); - Akonadi2::Domain::Buffer::FinishEventBuffer(eventFbb, eventLocation); + Akonadi2::ApplicationDomain::Buffer::FinishEventBuffer(eventFbb, eventLocation); } flatbuffers::FlatBufferBuilder localFbb; { auto uid = localFbb.CreateString("testuid"); - auto localBuilder = Akonadi2::Domain::Buffer::EventBuilder(localFbb); + auto localBuilder = Akonadi2::ApplicationDomain::Buffer::EventBuilder(localFbb); localBuilder.add_uid(uid); auto location = localBuilder.Finish(); - Akonadi2::Domain::Buffer::FinishEventBuffer(localFbb, location); + Akonadi2::ApplicationDomain::Buffer::FinishEventBuffer(localFbb, location); } flatbuffers::FlatBufferBuilder entityFbb; Akonadi2::EntityBuffer::assembleEntityBuffer(entityFbb, 0, 0, eventFbb.GetBufferPointer(), eventFbb.GetSize(), localFbb.GetBufferPointer(), localFbb.GetSize()); flatbuffers::FlatBufferBuilder fbb; - auto type = fbb.CreateString(Akonadi2::Domain::getTypeName().toStdString().data()); + auto type = fbb.CreateString(Akonadi2::ApplicationDomain::getTypeName().toStdString().data()); auto delta = fbb.CreateVector(entityFbb.GetBufferPointer(), entityFbb.GetSize()); Akonadi2::Commands::CreateEntityBuilder builder(fbb); builder.add_domainType(type); @@ -98,18 +98,18 @@ private Q_SLOTS: void testProperty() { - Akonadi2::Domain::Event event; + Akonadi2::ApplicationDomain::Event event; event.setProperty("uid", "testuid"); QCOMPARE(event.getProperty("uid").toByteArray(), QByteArray("testuid")); } void testWriteToFacadeAndQueryByUid() { - Akonadi2::Domain::Event event; + Akonadi2::ApplicationDomain::Event event; event.setProperty("uid", "testuid"); QCOMPARE(event.getProperty("uid").toByteArray(), QByteArray("testuid")); event.setProperty("summary", "summaryValue"); - Akonadi2::Store::create(event, "org.kde.dummy"); + Akonadi2::Store::create(event, "org.kde.dummy"); Akonadi2::Query query; query.resources << "org.kde.dummy"; @@ -117,7 +117,7 @@ private Q_SLOTS: query.processAll = true; query.propertyFilter.insert("uid", "testuid"); - async::SyncListResult result(Akonadi2::Store::load(query)); + async::SyncListResult result(Akonadi2::Store::load(query)); result.exec(); QCOMPARE(result.size(), 1); auto value = result.first(); @@ -147,7 +147,7 @@ private Q_SLOTS: query.syncOnDemand = true; query.processAll = true; - async::SyncListResult result(Akonadi2::Store::load(query)); + async::SyncListResult result(Akonadi2::Store::load(query)); result.exec(); QVERIFY(!result.isEmpty()); auto value = result.first(); -- cgit v1.2.3