summaryrefslogtreecommitdiffstats
path: root/storage/src/tests/common
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2023-02-05 18:45:19 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2023-02-05 18:49:27 +0000
commit3659f6921137e2f930ac0ce70847bcc67d7d0d1a (patch)
tree21adb857c7df16a61f2f5c74bda526120e2907c4 /storage/src/tests/common
parent613b4473d677e0b16a7ab4b9b5a4c2b105385a05 (diff)
Annotate overridden getComponentRegister
Diffstat (limited to 'storage/src/tests/common')
-rw-r--r--storage/src/tests/common/teststorageapp.cpp2
-rw-r--r--storage/src/tests/common/teststorageapp.h27
2 files changed, 12 insertions, 17 deletions
diff --git a/storage/src/tests/common/teststorageapp.cpp b/storage/src/tests/common/teststorageapp.cpp
index fae71f15bca..94996346d73 100644
--- a/storage/src/tests/common/teststorageapp.cpp
+++ b/storage/src/tests/common/teststorageapp.cpp
@@ -93,7 +93,7 @@ TestStorageApp::waitUntilInitialized(StorageBucketDBInitializer* initializer, ve
vespalib::steady_time currentTime(clock.getMonotonicTime());
if (currentTime > endTime) {
std::ostringstream error;
- error << "Failed to initialize service layer within timeout of " << timeout << " seconds.";
+ error << "Failed to initialize service layer within timeout of " << vespalib::to_s(timeout) << " seconds.";
if (initializer != nullptr) {
error << " ";
LOG(error, "%s", error.str().c_str());
diff --git a/storage/src/tests/common/teststorageapp.h b/storage/src/tests/common/teststorageapp.h
index 185fe50cbad..7ca910721b3 100644
--- a/storage/src/tests/common/teststorageapp.h
+++ b/storage/src/tests/common/teststorageapp.h
@@ -68,7 +68,7 @@ public:
TestStorageApp(StorageComponentRegisterImpl::UP compReg,
const lib::NodeType&, NodeIndex = NodeIndex(0xffff),
vespalib::stringref configId = "");
- ~TestStorageApp();
+ ~TestStorageApp() override;
// Set functions, to be able to modify content while running.
void setDistribution(Redundancy, NodeCount);
@@ -77,15 +77,12 @@ public:
// Utility functions for getting a hold of currently used bits. Practical
// to avoid adding extra components in the tests.
- StorageComponentRegisterImpl& getComponentRegister() { return _compReg; }
+ virtual StorageComponentRegisterImpl& getComponentRegister() override { return _compReg; }
document::TestDocMan& getTestDocMan() { return _docMan; }
- std::shared_ptr<const document::DocumentTypeRepo> getTypeRepo()
- { return _compReg.getTypeRepo(); }
- const document::BucketIdFactory& getBucketIdFactory()
- { return _compReg.getBucketIdFactory(); }
+ std::shared_ptr<const document::DocumentTypeRepo> getTypeRepo() { return _compReg.getTypeRepo(); }
+ const document::BucketIdFactory& getBucketIdFactory() { return _compReg.getBucketIdFactory(); }
TestNodeStateUpdater& getStateUpdater() { return _nodeStateUpdater; }
- std::shared_ptr<lib::Distribution> & getDistribution()
- { return _compReg.getDistribution(); }
+ std::shared_ptr<lib::Distribution> & getDistribution() { return _compReg.getDistribution(); }
TestNodeStateUpdater& getNodeStateUpdater() { return _nodeStateUpdater; }
uint16_t getIndex() const { return _compReg.getIndex(); }
const NodeIdentity& node_identity() const noexcept { return _node_identity; }
@@ -95,9 +92,7 @@ public:
DoneInitializeHandler& getDoneInitializeHandler() { return *this; }
void notifyDoneInitializing() override { _initialized = true; }
bool isInitialized() const { return _initialized; }
- void waitUntilInitialized(
- StorageBucketDBInitializer* initializer = 0,
- vespalib::duration timeout = 30s) const;
+ void waitUntilInitialized(StorageBucketDBInitializer* initializer = nullptr, vespalib::duration timeout = 30s) const;
private:
// Storage server interface implementation (until we can remove it)
@@ -116,14 +111,14 @@ class TestServiceLayerApp : public TestStorageApp
HostInfo _host_info;
public:
- TestServiceLayerApp(vespalib::stringref configId);
- TestServiceLayerApp(NodeIndex = NodeIndex(0xffff), vespalib::stringref configId = "");
- ~TestServiceLayerApp();
+ explicit TestServiceLayerApp(vespalib::stringref configId);
+ explicit TestServiceLayerApp(NodeIndex = NodeIndex(0xffff), vespalib::stringref configId = "");
+ ~TestServiceLayerApp() override;
void setupDummyPersistence();
void setPersistenceProvider(PersistenceProviderUP);
- ServiceLayerComponentRegisterImpl& getComponentRegister() { return _compReg; }
+ ServiceLayerComponentRegisterImpl& getComponentRegister() override { return _compReg; }
HostInfo &get_host_info() noexcept { return _host_info; }
spi::PersistenceProvider& getPersistenceProvider();
@@ -153,7 +148,7 @@ public:
explicit TestDistributorApp(NodeIndex index, vespalib::stringref configId = "");
~TestDistributorApp() override;
- DistributorComponentRegisterImpl& getComponentRegister() {
+ DistributorComponentRegisterImpl& getComponentRegister() override {
return _compReg;
}