summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--storage/src/tests/common/teststorageapp.cpp2
-rw-r--r--storage/src/tests/common/teststorageapp.h27
-rw-r--r--storage/src/vespa/storageframework/defaultimplementation/component/testcomponentregister.h10
3 files changed, 17 insertions, 22 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;
}
diff --git a/storage/src/vespa/storageframework/defaultimplementation/component/testcomponentregister.h b/storage/src/vespa/storageframework/defaultimplementation/component/testcomponentregister.h
index bd4afa6c9ad..d228dace1ed 100644
--- a/storage/src/vespa/storageframework/defaultimplementation/component/testcomponentregister.h
+++ b/storage/src/vespa/storageframework/defaultimplementation/component/testcomponentregister.h
@@ -21,14 +21,14 @@ namespace storage::framework::defaultimplementation {
class TestComponentRegister {
ComponentRegisterImpl::UP _compReg;
- FakeClock _clock;
- ThreadPoolImpl _threadPool;
+ FakeClock _clock;
+ ThreadPoolImpl _threadPool;
public:
- TestComponentRegister(ComponentRegisterImpl::UP compReg);
- ~TestComponentRegister();
+ explicit TestComponentRegister(ComponentRegisterImpl::UP compReg);
+ virtual ~TestComponentRegister();
- ComponentRegisterImpl& getComponentRegister() { return *_compReg; }
+ virtual ComponentRegisterImpl& getComponentRegister() { return *_compReg; }
FakeClock& getClock() { return _clock; }
ThreadPoolImpl& getThreadPoolImpl() { return _threadPool; }
FastOS_ThreadPool& getThreadPool() { return _threadPool.getThreadPool(); }