summaryrefslogtreecommitdiffstats
path: root/config/src/tests/configmanager/configmanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'config/src/tests/configmanager/configmanager.cpp')
-rw-r--r--config/src/tests/configmanager/configmanager.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/config/src/tests/configmanager/configmanager.cpp b/config/src/tests/configmanager/configmanager.cpp
index 2cc5d4fad4f..9bed974f628 100644
--- a/config/src/tests/configmanager/configmanager.cpp
+++ b/config/src/tests/configmanager/configmanager.cpp
@@ -1,11 +1,12 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include <vespa/vespalib/testkit/test_kit.h>
-#include <vespa/vespalib/util/noncopyable.hpp>
#include <vespa/config/common/configmanager.h>
#include <vespa/config/common/exceptions.h>
#include <vespa/config/common/timingvalues.h>
#include <vespa/config/subscription/sourcespec.h>
+#include <vespa/config/common/iconfigholder.h>
+
#include <vespa/config/raw/rawsource.h>
#include "config-my.h"
@@ -36,12 +37,12 @@ namespace {
class MySource : public Source
{
public:
- MySource(TestContext * data, const IConfigHolder::SP & holder) : _holder(holder), _data(data) { }
+ MySource(TestContext * data, std::shared_ptr<IConfigHolder> holder) : _holder(std::move(holder)), _data(data) { }
void getConfig() override
{
_data->numGetConfig++;
if (_data->respond) {
- _holder->handle(ConfigUpdate::UP(new ConfigUpdate(ConfigValue(), true, _data->generation)));
+ _holder->handle(std::make_unique<ConfigUpdate>(ConfigValue(), true, _data->generation));
}
}
void reload(int64_t generation) override
@@ -53,7 +54,7 @@ namespace {
{
_data->numClose++;
}
- IConfigHolder::SP _holder;
+ std::shared_ptr<IConfigHolder> _holder;
TestContext * _data;
};
@@ -61,10 +62,10 @@ namespace {
{
public:
MySourceFactory(TestContext * d) : data(d) { }
- Source::UP createSource(const IConfigHolder::SP & holder, const ConfigKey & key) const override
+ std::unique_ptr<Source> createSource(std::shared_ptr<IConfigHolder> holder, const ConfigKey & key) const override
{
(void) key;
- return Source::UP(new MySource(data, holder));
+ return std::make_unique<MySource>(data, std::move(holder));
}
TestContext * data;
};
@@ -78,9 +79,9 @@ namespace {
{
}
SourceSpecKey createKey() const { return SourceSpecKey(_key); }
- SourceFactory::UP createSourceFactory(const TimingValues & timingValues) const override {
+ std::unique_ptr<SourceFactory> createSourceFactory(const TimingValues & timingValues) const override {
(void) timingValues;
- return SourceFactory::UP(new MySourceFactory(_data));
+ return std::make_unique<MySourceFactory>(_data);
}
SourceSpec * clone() const { return new MySpec(*this); }
private: