diff options
author | Geir Storli <geirstorli@yahoo.no> | 2018-04-04 14:44:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-04 14:44:13 +0200 |
commit | a3d2dad8b01377a87754b714f54ff05c87bf1f8c (patch) | |
tree | 870e326f7d7f25b3caf4d029638c977f0c1712f3 /storage/src/tests | |
parent | f86708b7b67e38289384d03079f461f532b8763c (diff) | |
parent | 8cfeaeba255ccea54f8345724e72adf53280e33d (diff) |
Merge pull request #5455 from vespa-engine/toregge/use-shared-ptr-to-const-document-type-repo
Use shared pointer to const DocumentTypeRepo.
Diffstat (limited to 'storage/src/tests')
12 files changed, 13 insertions, 13 deletions
diff --git a/storage/src/tests/bucketdb/bucketmanagertest.cpp b/storage/src/tests/bucketdb/bucketmanagertest.cpp index 8cc046861be..0c7122547db 100644 --- a/storage/src/tests/bucketdb/bucketmanagertest.cpp +++ b/storage/src/tests/bucketdb/bucketmanagertest.cpp @@ -199,7 +199,7 @@ void BucketManagerTest::setupTestEnvironment(bool fakePersistenceLayer, assert(system(getMkDirDisk(rootFolder, 0).c_str()) == 0); assert(system(getMkDirDisk(rootFolder, 1).c_str()) == 0); - DocumentTypeRepo::SP repo(new DocumentTypeRepo( + std::shared_ptr<const DocumentTypeRepo> repo(new DocumentTypeRepo( *ConfigGetter<DocumenttypesConfig>::getConfig( "config-doctypes", FileSpec(TEST_PATH("config-doctypes.cfg"))))); _top.reset(new DummyStorageLink); diff --git a/storage/src/tests/common/teststorageapp.cpp b/storage/src/tests/common/teststorageapp.cpp index 95237d1bfcb..8fd80d47bb3 100644 --- a/storage/src/tests/common/teststorageapp.cpp +++ b/storage/src/tests/common/teststorageapp.cpp @@ -90,7 +90,7 @@ TestStorageApp::setDistribution(Redundancy redundancy, NodeCount nodeCount) } void -TestStorageApp::setTypeRepo(document::DocumentTypeRepo::SP repo) +TestStorageApp::setTypeRepo(std::shared_ptr<const document::DocumentTypeRepo> repo) { _compReg.setDocumentTypeRepo(repo); } diff --git a/storage/src/tests/common/teststorageapp.h b/storage/src/tests/common/teststorageapp.h index 369cdedc583..867ac9d38fc 100644 --- a/storage/src/tests/common/teststorageapp.h +++ b/storage/src/tests/common/teststorageapp.h @@ -68,14 +68,14 @@ public: // Set functions, to be able to modify content while running. void setDistribution(Redundancy, NodeCount); - void setTypeRepo(document::DocumentTypeRepo::SP repo); + void setTypeRepo(std::shared_ptr<const document::DocumentTypeRepo> repo); void setClusterState(const lib::ClusterState&); // Utility functions for getting a hold of currently used bits. Practical // to avoid adding extra components in the tests. StorageComponentRegisterImpl& getComponentRegister() { return _compReg; } document::TestDocMan& getTestDocMan() { return _docMan; } - document::DocumentTypeRepo::SP getTypeRepo() + std::shared_ptr<const document::DocumentTypeRepo> getTypeRepo() { return _compReg.getTypeRepo(); } const document::BucketIdFactory& getBucketIdFactory() { return _compReg.getBucketIdFactory(); } diff --git a/storage/src/tests/distributor/distributortestutil.cpp b/storage/src/tests/distributor/distributortestutil.cpp index 33167d61026..e43161946fb 100644 --- a/storage/src/tests/distributor/distributortestutil.cpp +++ b/storage/src/tests/distributor/distributortestutil.cpp @@ -83,7 +83,7 @@ DistributorTestUtil::triggerDistributionChange(lib::Distribution::SP distr) } void -DistributorTestUtil::setTypeRepo(const document::DocumentTypeRepo::SP &repo) +DistributorTestUtil::setTypeRepo(const std::shared_ptr<const document::DocumentTypeRepo> &repo) { _node->getComponentRegister().setDocumentTypeRepo(repo); } diff --git a/storage/src/tests/distributor/distributortestutil.h b/storage/src/tests/distributor/distributortestutil.h index c2cb4fb2a62..69b5a5cdf6a 100644 --- a/storage/src/tests/distributor/distributortestutil.h +++ b/storage/src/tests/distributor/distributortestutil.h @@ -35,7 +35,7 @@ public: * Sets up the storage link chain. */ void createLinks(); - void setTypeRepo(const document::DocumentTypeRepo::SP &repo); + void setTypeRepo(const std::shared_ptr<const document::DocumentTypeRepo> &repo); void close(); diff --git a/storage/src/tests/distributor/getoperationtest.cpp b/storage/src/tests/distributor/getoperationtest.cpp index 80636bd33a7..064348539bf 100644 --- a/storage/src/tests/distributor/getoperationtest.cpp +++ b/storage/src/tests/distributor/getoperationtest.cpp @@ -43,7 +43,7 @@ class GetOperationTest : public CppUnit::TestFixture, public DistributorTestUtil CPPUNIT_TEST(canGetDocumentsWhenAllReplicaNodesRetired); CPPUNIT_TEST_SUITE_END(); - document::DocumentTypeRepo::SP _repo; + std::shared_ptr<const document::DocumentTypeRepo> _repo; public: document::DocumentId docId; diff --git a/storage/src/tests/distributor/operationtargetresolvertest.cpp b/storage/src/tests/distributor/operationtargetresolvertest.cpp index fe5373a936f..17dbf007c63 100644 --- a/storage/src/tests/distributor/operationtargetresolvertest.cpp +++ b/storage/src/tests/distributor/operationtargetresolvertest.cpp @@ -27,7 +27,7 @@ struct OperationTargetResolverTest : public CppUnit::TestFixture, public DistributorTestUtil { - document::DocumentTypeRepo::SP _repo; + std::shared_ptr<const document::DocumentTypeRepo> _repo; const document::DocumentType* _html_type; std::unique_ptr<Operation> op; diff --git a/storage/src/tests/distributor/putoperationtest.cpp b/storage/src/tests/distributor/putoperationtest.cpp index 776e0275f68..b43d3cf64ad 100644 --- a/storage/src/tests/distributor/putoperationtest.cpp +++ b/storage/src/tests/distributor/putoperationtest.cpp @@ -59,7 +59,7 @@ class PutOperationTest : public CppUnit::TestFixture, CPPUNIT_TEST(replicaNotImplicitlyActivatedWhenActivationIsDisabled); CPPUNIT_TEST_SUITE_END(); - DocumentTypeRepo::SP _repo; + std::shared_ptr<const DocumentTypeRepo> _repo; const DocumentType* _html_type; std::unique_ptr<Operation> op; diff --git a/storage/src/tests/distributor/twophaseupdateoperationtest.cpp b/storage/src/tests/distributor/twophaseupdateoperationtest.cpp index ed961b29b1c..29d50b1b9b7 100644 --- a/storage/src/tests/distributor/twophaseupdateoperationtest.cpp +++ b/storage/src/tests/distributor/twophaseupdateoperationtest.cpp @@ -68,7 +68,7 @@ class TwoPhaseUpdateOperationTest : public CppUnit::TestFixture, CPPUNIT_TEST_SUITE_END(); document::TestDocRepo _testRepo; - DocumentTypeRepo::SP _repo; + std::shared_ptr<const DocumentTypeRepo> _repo; const DocumentType* _doc_type; protected: diff --git a/storage/src/tests/distributor/updateoperationtest.cpp b/storage/src/tests/distributor/updateoperationtest.cpp index c15a2b4057c..ccbee0093ba 100644 --- a/storage/src/tests/distributor/updateoperationtest.cpp +++ b/storage/src/tests/distributor/updateoperationtest.cpp @@ -35,7 +35,7 @@ class UpdateOperation_Test : public CppUnit::TestFixture, CPPUNIT_TEST(testMultiNodeInconsistentTimestamp); CPPUNIT_TEST_SUITE_END(); - DocumentTypeRepo::SP _repo; + std::shared_ptr<const DocumentTypeRepo> _repo; const DocumentType *_html_type; protected: diff --git a/storage/src/tests/persistence/persistencetestutils.h b/storage/src/tests/persistence/persistencetestutils.h index 36b1fef7285..22ab954cc6a 100644 --- a/storage/src/tests/persistence/persistencetestutils.h +++ b/storage/src/tests/persistence/persistencetestutils.h @@ -62,7 +62,7 @@ public: FileStorHandler& fsHandler() { return *_env->_handler; } FileStorMetrics& metrics() { return _env->_metrics; } MessageKeeper& messageKeeper() { return _env->_messageKeeper; } - document::DocumentTypeRepo::SP getTypeRepo() { return _env->_component.getTypeRepo(); } + std::shared_ptr<const document::DocumentTypeRepo> getTypeRepo() { return _env->_component.getTypeRepo(); } StorageComponent& getComponent() { return _env->_component; } TestServiceLayerApp& getNode() { return _env->_node; } diff --git a/storage/src/tests/storageserver/documentapiconvertertest.cpp b/storage/src/tests/storageserver/documentapiconvertertest.cpp index caf498cb272..1c38107cb06 100644 --- a/storage/src/tests/storageserver/documentapiconvertertest.cpp +++ b/storage/src/tests/storageserver/documentapiconvertertest.cpp @@ -61,7 +61,7 @@ struct DocumentApiConverterTest : public CppUnit::TestFixture { std::shared_ptr<MockBucketResolver> _bucketResolver; std::unique_ptr<DocumentApiConverter> _converter; - const DocumentTypeRepo::SP _repo; + const std::shared_ptr<const DocumentTypeRepo> _repo; const DataType& _html_type; DocumentApiConverterTest() |