Skip to content

Commit c25bc2b

Browse files
author
Razvan Becheriu
committed
[#3190] addressed review comments
1 parent 133ccdf commit c25bc2b

18 files changed

+32
-32
lines changed

src/bin/netconf/tests/netconf_unittests.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ class NetconfAgentLogTest : public dhcp::test::LogContentTest {
193193
: finished_(false),
194194
io_service_(new IOService()),
195195
thread_(),
196-
agent_(new NakedNetconfAgent) {
196+
agent_(new NakedNetconfAgent()) {
197197
}
198198

199199
/// @brief Destructor.

src/hooks/dhcp/high_availability/tests/ha_impl_unittest.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class HAImplTest : public HATest {
103103
/// @param expected_response expected text response.
104104
void testSynchronizeHandler(const std::string& ha_sync_command,
105105
const std::string& expected_response) {
106-
io_service_.reset(new IOService);
106+
io_service_.reset(new IOService());
107107
ha_impl_.reset(new HAImpl());
108108
ASSERT_NO_THROW(ha_impl_->configure(createValidJsonConfiguration()));
109109

src/lib/asiolink/tests/tcp_socket_unittest.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ serverRead(tcp::socket& socket, TCPCallback& server_cb) {
234234
TEST(TCPSocket, processReceivedData) {
235235
const uint16_t PACKET_SIZE = 16382; // Amount of "real" data in the buffer
236236

237-
IOServicePtr service(new IOService); // Used to instantiate socket
237+
IOServicePtr service(new IOService()); // Used to instantiate socket
238238
TCPSocket<TCPCallback> test(service); // Socket under test
239239
uint8_t inbuff[PACKET_SIZE + 2]; // Buffer to check
240240
OutputBufferPtr outbuff(new OutputBuffer(16));

src/lib/cc/data.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1361,7 +1361,7 @@ mergeDiffDel(ElementPtr& element, ElementPtr& other,
13611361
}
13621362
return;
13631363
}
1364-
element = ElementPtr(new NullElement);
1364+
element = ElementPtr(new NullElement());
13651365
}
13661366

13671367
void

src/lib/dhcp/libdhcp++.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1284,7 +1284,7 @@ bool
12841284
LibDHCP::initOptionDefs() {
12851285
for (uint32_t i = 0; OPTION_DEF_PARAMS[i].optionDefParams; ++i) {
12861286
string space = OPTION_DEF_PARAMS[i].space;
1287-
option_defs_[space] = OptionDefContainerPtr(new OptionDefContainer);
1287+
option_defs_[space] = OptionDefContainerPtr(new OptionDefContainer());
12881288
initOptionSpace(option_defs_[space],
12891289
OPTION_DEF_PARAMS[i].optionDefParams,
12901290
OPTION_DEF_PARAMS[i].size);

src/lib/dhcp_ddns/ncr_io.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ NameChangeListener::invokeRecvHandler(const Result result,
159159
NameChangeSender::NameChangeSender(RequestSendHandler& send_handler,
160160
size_t send_queue_max)
161161
: sending_(false), send_handler_(send_handler),
162-
send_queue_max_(send_queue_max), mutex_(new mutex) {
162+
send_queue_max_(send_queue_max), mutex_(new mutex()) {
163163

164164
// Queue size must be big enough to hold at least 1 entry.
165165
setQueueMaxSize(send_queue_max);

src/lib/dhcpsrv/testutils/generic_cb_recovery_unittest.cc

+4-4
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ GenericConfigBackendDbLostCallbackTest::testRetryOpenDbLostAndRecoveredCallback(
9191
config_ctl_info->addConfigDatabase(access);
9292
CfgMgr::instance().getCurrentCfg()->setConfigControlInfo(config_ctl_info);
9393

94-
std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry);
94+
std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry());
9595

9696
// Connect to the CB backend.
9797
ASSERT_THROW(addBackend(access), DbOpenErrorWithRetry);
@@ -146,7 +146,7 @@ GenericConfigBackendDbLostCallbackTest::testRetryOpenDbLostAndFailedCallback() {
146146
config_ctl_info->addConfigDatabase(access);
147147
CfgMgr::instance().getCurrentCfg()->setConfigControlInfo(config_ctl_info);
148148

149-
std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry);
149+
std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry());
150150

151151
// Connect to the CB backend.
152152
ASSERT_THROW(addBackend(access), DbOpenErrorWithRetry);
@@ -194,7 +194,7 @@ GenericConfigBackendDbLostCallbackTest::testRetryOpenDbLostAndRecoveredAfterTime
194194
config_ctl_info->addConfigDatabase(access);
195195
CfgMgr::instance().getCurrentCfg()->setConfigControlInfo(config_ctl_info);
196196

197-
std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry);
197+
std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry());
198198

199199
// Connect to the CB backend.
200200
ASSERT_THROW(addBackend(access), DbOpenErrorWithRetry);
@@ -270,7 +270,7 @@ GenericConfigBackendDbLostCallbackTest::testRetryOpenDbLostAndFailedAfterTimeout
270270
config_ctl_info->addConfigDatabase(access);
271271
CfgMgr::instance().getCurrentCfg()->setConfigControlInfo(config_ctl_info);
272272

273-
std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry);
273+
std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry());
274274

275275
// Connect to the CB backend.
276276
ASSERT_THROW(addBackend(access), DbOpenErrorWithRetry);

src/lib/dhcpsrv/testutils/generic_host_data_source_unittest.cc

+4-4
Original file line numberDiff line numberDiff line change
@@ -2685,7 +2685,7 @@ HostMgrDbLostCallbackTest::testRetryOpenDbLostAndRecoveredCallback() {
26852685
access += " retry-on-startup=true";
26862686
CfgMgr::instance().getCurrentCfg()->getCfgDbAccess()->setHostDbAccessString(access);
26872687

2688-
std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry);
2688+
std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry());
26892689

26902690
// Create the HostMgr.
26912691
HostMgr::create();
@@ -2729,7 +2729,7 @@ HostMgrDbLostCallbackTest::testRetryOpenDbLostAndFailedCallback() {
27292729
access += " retry-on-startup=true";
27302730
CfgMgr::instance().getCurrentCfg()->getCfgDbAccess()->setHostDbAccessString(access);
27312731

2732-
std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry);
2732+
std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry());
27332733

27342734
// Create the HostMgr.
27352735
HostMgr::create();
@@ -2769,7 +2769,7 @@ HostMgrDbLostCallbackTest::testRetryOpenDbLostAndRecoveredAfterTimeoutCallback()
27692769
access += extra;
27702770
CfgMgr::instance().getCurrentCfg()->getCfgDbAccess()->setHostDbAccessString(access);
27712771

2772-
std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry);
2772+
std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry());
27732773

27742774
// Create the HostMgr.
27752775
HostMgr::create();
@@ -2834,7 +2834,7 @@ HostMgrDbLostCallbackTest::testRetryOpenDbLostAndFailedAfterTimeoutCallback() {
28342834
access += extra;
28352835
CfgMgr::instance().getCurrentCfg()->getCfgDbAccess()->setHostDbAccessString(access);
28362836

2837-
std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry);
2837+
std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry());
28382838

28392839
// Create the HostMgr.
28402840
HostMgr::create();

src/lib/dhcpsrv/testutils/generic_lease_mgr_unittest.cc

+4-4
Original file line numberDiff line numberDiff line change
@@ -3427,7 +3427,7 @@ LeaseMgrDbLostCallbackTest::testRetryOpenDbLostAndRecoveredCallback() {
34273427
access += " retry-on-startup=true";
34283428
CfgMgr::instance().getCurrentCfg()->getCfgDbAccess()->setLeaseDbAccessString(access);
34293429

3430-
std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry);
3430+
std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry());
34313431

34323432
// Connect to the lease backend.
34333433
ASSERT_THROW(LeaseMgrFactory::create(access), DbOpenErrorWithRetry);
@@ -3468,7 +3468,7 @@ LeaseMgrDbLostCallbackTest::testRetryOpenDbLostAndFailedCallback() {
34683468
access += " retry-on-startup=true";
34693469
CfgMgr::instance().getCurrentCfg()->getCfgDbAccess()->setLeaseDbAccessString(access);
34703470

3471-
std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry);
3471+
std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry());
34723472

34733473
// Connect to the lease backend.
34743474
ASSERT_THROW(LeaseMgrFactory::create(access), DbOpenErrorWithRetry);
@@ -3506,7 +3506,7 @@ LeaseMgrDbLostCallbackTest::testRetryOpenDbLostAndRecoveredAfterTimeoutCallback(
35063506
access += extra;
35073507
CfgMgr::instance().getCurrentCfg()->getCfgDbAccess()->setLeaseDbAccessString(access);
35083508

3509-
std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry);
3509+
std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry());
35103510

35113511
// Connect to the lease backend.
35123512
ASSERT_THROW(LeaseMgrFactory::create(access), DbOpenErrorWithRetry);
@@ -3568,7 +3568,7 @@ LeaseMgrDbLostCallbackTest::testRetryOpenDbLostAndFailedAfterTimeoutCallback() {
35683568
access += extra;
35693569
CfgMgr::instance().getCurrentCfg()->getCfgDbAccess()->setLeaseDbAccessString(access);
35703570

3571-
std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry);
3571+
std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry());
35723572

35733573
// Connect to the lease backend.
35743574
ASSERT_THROW(LeaseMgrFactory::create(access), DbOpenErrorWithRetry);

src/lib/dns/master_lexer.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ struct MasterLexer::MasterLexerImpl {
126126
bool previous_was_eol_;
127127
};
128128

129-
MasterLexer::MasterLexer() : impl_(new MasterLexerImpl) {
129+
MasterLexer::MasterLexer() : impl_(new MasterLexerImpl()) {
130130
}
131131

132132
MasterLexer::~MasterLexer() {

src/lib/dns/messagerenderer.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,8 @@ struct MessageRenderer::MessageRendererImpl {
220220

221221
MessageRenderer::MessageRenderer() :
222222
AbstractMessageRenderer(),
223-
impl_(new MessageRendererImpl)
224-
{}
223+
impl_(new MessageRendererImpl()) {
224+
}
225225

226226
MessageRenderer::~MessageRenderer() {
227227
delete impl_;

src/lib/dns/rdata/generic/opt_41.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ struct OPTImpl {
5454

5555
/// \brief Default constructor.
5656
OPT::OPT() :
57-
impl_(new OPTImpl)
57+
impl_(new OPTImpl())
5858
{
5959
}
6060

@@ -84,7 +84,7 @@ OPT::OPT(MasterLexer&, const Name*,
8484
OPT::OPT(InputBuffer& buffer, size_t rdata_len) :
8585
impl_(NULL)
8686
{
87-
std::unique_ptr<OPTImpl> impl_ptr(new OPTImpl);
87+
std::unique_ptr<OPTImpl> impl_ptr(new OPTImpl());
8888

8989
while (true) {
9090
if (rdata_len == 0) {

src/lib/dns/rdataclass.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -3689,7 +3689,7 @@ struct OPTImpl {
36893689

36903690
/// \brief Default constructor.
36913691
OPT::OPT() :
3692-
impl_(new OPTImpl)
3692+
impl_(new OPTImpl())
36933693
{
36943694
}
36953695

@@ -3719,7 +3719,7 @@ OPT::OPT(MasterLexer&, const Name*,
37193719
OPT::OPT(InputBuffer& buffer, size_t rdata_len) :
37203720
impl_(NULL)
37213721
{
3722-
std::unique_ptr<OPTImpl> impl_ptr(new OPTImpl);
3722+
std::unique_ptr<OPTImpl> impl_ptr(new OPTImpl());
37233723

37243724
while (true) {
37253725
if (rdata_len == 0) {

src/lib/dns/tests/rrparamregistry_unittest.cc

+3-3
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ TEST_F(RRParamRegistryTest, addRemoveFactory) {
122122
// Add factories so that we can treat this pair just like in::A.
123123
RRParamRegistry::getRegistry().add(test_type_str, test_type_code,
124124
test_class_str, test_class_code,
125-
RdataFactoryPtr(new TestRdataFactory));
125+
RdataFactoryPtr(new TestRdataFactory()));
126126
// Now it should be accepted, and should be identical to the same data of
127127
// in::A.
128128
EXPECT_EQ(0, in::A("192.0.2.1").compare(
@@ -135,7 +135,7 @@ TEST_F(RRParamRegistryTest, addRemoveFactory) {
135135
InvalidRdataText);
136136
// Add the factories also as a class independent RRtype
137137
RRParamRegistry::getRegistry().add(test_type_str, test_type_code,
138-
RdataFactoryPtr(new TestRdataFactory));
138+
RdataFactoryPtr(new TestRdataFactory()));
139139
// Now it should be okay for other classes than the test class.
140140
EXPECT_EQ(0, in::A("192.0.2.1").compare(
141141
*createRdata(RRType(test_type_code), RRClass("IN"),
@@ -155,7 +155,7 @@ TEST_F(RRParamRegistryTest, addRemoveFactory) {
155155

156156
RdataPtr
157157
createRdataHelper(const std::string& str) {
158-
boost::scoped_ptr<AbstractRdataFactory> rdf(new TestRdataFactory);
158+
boost::scoped_ptr<AbstractRdataFactory> rdf(new TestRdataFactory());
159159

160160
std::stringstream ss(str);
161161
MasterLexer lexer;

src/lib/dns/tsigkey.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ struct TSIGKeyRing::TSIGKeyRingImpl {
311311
TSIGKeyMap keys;
312312
};
313313

314-
TSIGKeyRing::TSIGKeyRing() : impl_(new TSIGKeyRingImpl) {
314+
TSIGKeyRing::TSIGKeyRing() : impl_(new TSIGKeyRingImpl()) {
315315
}
316316

317317
TSIGKeyRing::~TSIGKeyRing() {

src/lib/process/tests/d_cfg_mgr_unittests.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class DStubCfgMgrTest : public ConfigParseTest {
5959
public:
6060

6161
/// @brief Constructor
62-
DStubCfgMgrTest():cfg_mgr_(new DStubCfgMgr) {
62+
DStubCfgMgrTest():cfg_mgr_(new DStubCfgMgr()) {
6363
}
6464

6565
/// @brief Destructor

src/lib/process/tests/daemon_unittest.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ TEST_F(DaemonTest, createPIDFileOverwrite) {
248248
// Verifies that Daemon destruction deletes the PID file
249249
TEST_F(DaemonTest, PIDFileCleanup) {
250250
boost::shared_ptr<DaemonImpl> instance;
251-
instance.reset(new DaemonImpl);
251+
instance.reset(new DaemonImpl());
252252

253253
instance->setConfigFile("test.conf");
254254
instance->setProcName("daemon_test");

src/lib/stats/stats_mgr.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ StatsMgr::instance() {
3333
}
3434

3535
StatsMgr::StatsMgr() :
36-
global_(boost::make_shared<StatContext>()), mutex_(new mutex) {
36+
global_(boost::make_shared<StatContext>()), mutex_(new mutex()) {
3737
}
3838

3939
void

0 commit comments

Comments
 (0)