Skip to content

Commit

Permalink
[#3190] addressed review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Razvan Becheriu committed Mar 5, 2024
1 parent 133ccdf commit c25bc2b
Show file tree
Hide file tree
Showing 18 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion src/bin/netconf/tests/netconf_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ class NetconfAgentLogTest : public dhcp::test::LogContentTest {
: finished_(false),
io_service_(new IOService()),
thread_(),
agent_(new NakedNetconfAgent) {
agent_(new NakedNetconfAgent()) {
}

/// @brief Destructor.
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/dhcp/high_availability/tests/ha_impl_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class HAImplTest : public HATest {
/// @param expected_response expected text response.
void testSynchronizeHandler(const std::string& ha_sync_command,
const std::string& expected_response) {
io_service_.reset(new IOService);
io_service_.reset(new IOService());
ha_impl_.reset(new HAImpl());
ASSERT_NO_THROW(ha_impl_->configure(createValidJsonConfiguration()));

Expand Down
2 changes: 1 addition & 1 deletion src/lib/asiolink/tests/tcp_socket_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ serverRead(tcp::socket& socket, TCPCallback& server_cb) {
TEST(TCPSocket, processReceivedData) {
const uint16_t PACKET_SIZE = 16382; // Amount of "real" data in the buffer

IOServicePtr service(new IOService); // Used to instantiate socket
IOServicePtr service(new IOService()); // Used to instantiate socket
TCPSocket<TCPCallback> test(service); // Socket under test
uint8_t inbuff[PACKET_SIZE + 2]; // Buffer to check
OutputBufferPtr outbuff(new OutputBuffer(16));
Expand Down
2 changes: 1 addition & 1 deletion src/lib/cc/data.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1361,7 +1361,7 @@ mergeDiffDel(ElementPtr& element, ElementPtr& other,
}
return;
}
element = ElementPtr(new NullElement);
element = ElementPtr(new NullElement());
}

void
Expand Down
2 changes: 1 addition & 1 deletion src/lib/dhcp/libdhcp++.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1284,7 +1284,7 @@ bool
LibDHCP::initOptionDefs() {
for (uint32_t i = 0; OPTION_DEF_PARAMS[i].optionDefParams; ++i) {
string space = OPTION_DEF_PARAMS[i].space;
option_defs_[space] = OptionDefContainerPtr(new OptionDefContainer);
option_defs_[space] = OptionDefContainerPtr(new OptionDefContainer());
initOptionSpace(option_defs_[space],
OPTION_DEF_PARAMS[i].optionDefParams,
OPTION_DEF_PARAMS[i].size);
Expand Down
2 changes: 1 addition & 1 deletion src/lib/dhcp_ddns/ncr_io.cc
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ NameChangeListener::invokeRecvHandler(const Result result,
NameChangeSender::NameChangeSender(RequestSendHandler& send_handler,
size_t send_queue_max)
: sending_(false), send_handler_(send_handler),
send_queue_max_(send_queue_max), mutex_(new mutex) {
send_queue_max_(send_queue_max), mutex_(new mutex()) {

// Queue size must be big enough to hold at least 1 entry.
setQueueMaxSize(send_queue_max);
Expand Down
8 changes: 4 additions & 4 deletions src/lib/dhcpsrv/testutils/generic_cb_recovery_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ GenericConfigBackendDbLostCallbackTest::testRetryOpenDbLostAndRecoveredCallback(
config_ctl_info->addConfigDatabase(access);
CfgMgr::instance().getCurrentCfg()->setConfigControlInfo(config_ctl_info);

std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry);
std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry());

// Connect to the CB backend.
ASSERT_THROW(addBackend(access), DbOpenErrorWithRetry);
Expand Down Expand Up @@ -146,7 +146,7 @@ GenericConfigBackendDbLostCallbackTest::testRetryOpenDbLostAndFailedCallback() {
config_ctl_info->addConfigDatabase(access);
CfgMgr::instance().getCurrentCfg()->setConfigControlInfo(config_ctl_info);

std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry);
std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry());

// Connect to the CB backend.
ASSERT_THROW(addBackend(access), DbOpenErrorWithRetry);
Expand Down Expand Up @@ -194,7 +194,7 @@ GenericConfigBackendDbLostCallbackTest::testRetryOpenDbLostAndRecoveredAfterTime
config_ctl_info->addConfigDatabase(access);
CfgMgr::instance().getCurrentCfg()->setConfigControlInfo(config_ctl_info);

std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry);
std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry());

// Connect to the CB backend.
ASSERT_THROW(addBackend(access), DbOpenErrorWithRetry);
Expand Down Expand Up @@ -270,7 +270,7 @@ GenericConfigBackendDbLostCallbackTest::testRetryOpenDbLostAndFailedAfterTimeout
config_ctl_info->addConfigDatabase(access);
CfgMgr::instance().getCurrentCfg()->setConfigControlInfo(config_ctl_info);

std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry);
std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry());

// Connect to the CB backend.
ASSERT_THROW(addBackend(access), DbOpenErrorWithRetry);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2685,7 +2685,7 @@ HostMgrDbLostCallbackTest::testRetryOpenDbLostAndRecoveredCallback() {
access += " retry-on-startup=true";
CfgMgr::instance().getCurrentCfg()->getCfgDbAccess()->setHostDbAccessString(access);

std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry);
std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry());

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

std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry);
std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry());

// Create the HostMgr.
HostMgr::create();
Expand Down Expand Up @@ -2769,7 +2769,7 @@ HostMgrDbLostCallbackTest::testRetryOpenDbLostAndRecoveredAfterTimeoutCallback()
access += extra;
CfgMgr::instance().getCurrentCfg()->getCfgDbAccess()->setHostDbAccessString(access);

std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry);
std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry());

// Create the HostMgr.
HostMgr::create();
Expand Down Expand Up @@ -2834,7 +2834,7 @@ HostMgrDbLostCallbackTest::testRetryOpenDbLostAndFailedAfterTimeoutCallback() {
access += extra;
CfgMgr::instance().getCurrentCfg()->getCfgDbAccess()->setHostDbAccessString(access);

std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry);
std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry());

// Create the HostMgr.
HostMgr::create();
Expand Down
8 changes: 4 additions & 4 deletions src/lib/dhcpsrv/testutils/generic_lease_mgr_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3427,7 +3427,7 @@ LeaseMgrDbLostCallbackTest::testRetryOpenDbLostAndRecoveredCallback() {
access += " retry-on-startup=true";
CfgMgr::instance().getCurrentCfg()->getCfgDbAccess()->setLeaseDbAccessString(access);

std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry);
std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry());

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

std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry);
std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry());

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

std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry);
std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry());

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

std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry);
std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry());

// Connect to the lease backend.
ASSERT_THROW(LeaseMgrFactory::create(access), DbOpenErrorWithRetry);
Expand Down
2 changes: 1 addition & 1 deletion src/lib/dns/master_lexer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ struct MasterLexer::MasterLexerImpl {
bool previous_was_eol_;
};

MasterLexer::MasterLexer() : impl_(new MasterLexerImpl) {
MasterLexer::MasterLexer() : impl_(new MasterLexerImpl()) {
}

MasterLexer::~MasterLexer() {
Expand Down
4 changes: 2 additions & 2 deletions src/lib/dns/messagerenderer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ struct MessageRenderer::MessageRendererImpl {

MessageRenderer::MessageRenderer() :
AbstractMessageRenderer(),
impl_(new MessageRendererImpl)
{}
impl_(new MessageRendererImpl()) {
}

MessageRenderer::~MessageRenderer() {
delete impl_;
Expand Down
4 changes: 2 additions & 2 deletions src/lib/dns/rdata/generic/opt_41.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ struct OPTImpl {

/// \brief Default constructor.
OPT::OPT() :
impl_(new OPTImpl)
impl_(new OPTImpl())
{
}

Expand Down Expand Up @@ -84,7 +84,7 @@ OPT::OPT(MasterLexer&, const Name*,
OPT::OPT(InputBuffer& buffer, size_t rdata_len) :
impl_(NULL)
{
std::unique_ptr<OPTImpl> impl_ptr(new OPTImpl);
std::unique_ptr<OPTImpl> impl_ptr(new OPTImpl());

while (true) {
if (rdata_len == 0) {
Expand Down
4 changes: 2 additions & 2 deletions src/lib/dns/rdataclass.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3689,7 +3689,7 @@ struct OPTImpl {

/// \brief Default constructor.
OPT::OPT() :
impl_(new OPTImpl)
impl_(new OPTImpl())
{
}

Expand Down Expand Up @@ -3719,7 +3719,7 @@ OPT::OPT(MasterLexer&, const Name*,
OPT::OPT(InputBuffer& buffer, size_t rdata_len) :
impl_(NULL)
{
std::unique_ptr<OPTImpl> impl_ptr(new OPTImpl);
std::unique_ptr<OPTImpl> impl_ptr(new OPTImpl());

while (true) {
if (rdata_len == 0) {
Expand Down
6 changes: 3 additions & 3 deletions src/lib/dns/tests/rrparamregistry_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ TEST_F(RRParamRegistryTest, addRemoveFactory) {
// Add factories so that we can treat this pair just like in::A.
RRParamRegistry::getRegistry().add(test_type_str, test_type_code,
test_class_str, test_class_code,
RdataFactoryPtr(new TestRdataFactory));
RdataFactoryPtr(new TestRdataFactory()));
// Now it should be accepted, and should be identical to the same data of
// in::A.
EXPECT_EQ(0, in::A("192.0.2.1").compare(
Expand All @@ -135,7 +135,7 @@ TEST_F(RRParamRegistryTest, addRemoveFactory) {
InvalidRdataText);
// Add the factories also as a class independent RRtype
RRParamRegistry::getRegistry().add(test_type_str, test_type_code,
RdataFactoryPtr(new TestRdataFactory));
RdataFactoryPtr(new TestRdataFactory()));
// Now it should be okay for other classes than the test class.
EXPECT_EQ(0, in::A("192.0.2.1").compare(
*createRdata(RRType(test_type_code), RRClass("IN"),
Expand All @@ -155,7 +155,7 @@ TEST_F(RRParamRegistryTest, addRemoveFactory) {

RdataPtr
createRdataHelper(const std::string& str) {
boost::scoped_ptr<AbstractRdataFactory> rdf(new TestRdataFactory);
boost::scoped_ptr<AbstractRdataFactory> rdf(new TestRdataFactory());

std::stringstream ss(str);
MasterLexer lexer;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/dns/tsigkey.cc
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ struct TSIGKeyRing::TSIGKeyRingImpl {
TSIGKeyMap keys;
};

TSIGKeyRing::TSIGKeyRing() : impl_(new TSIGKeyRingImpl) {
TSIGKeyRing::TSIGKeyRing() : impl_(new TSIGKeyRingImpl()) {
}

TSIGKeyRing::~TSIGKeyRing() {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/process/tests/d_cfg_mgr_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class DStubCfgMgrTest : public ConfigParseTest {
public:

/// @brief Constructor
DStubCfgMgrTest():cfg_mgr_(new DStubCfgMgr) {
DStubCfgMgrTest():cfg_mgr_(new DStubCfgMgr()) {
}

/// @brief Destructor
Expand Down
2 changes: 1 addition & 1 deletion src/lib/process/tests/daemon_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ TEST_F(DaemonTest, createPIDFileOverwrite) {
// Verifies that Daemon destruction deletes the PID file
TEST_F(DaemonTest, PIDFileCleanup) {
boost::shared_ptr<DaemonImpl> instance;
instance.reset(new DaemonImpl);
instance.reset(new DaemonImpl());

instance->setConfigFile("test.conf");
instance->setProcName("daemon_test");
Expand Down
2 changes: 1 addition & 1 deletion src/lib/stats/stats_mgr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ StatsMgr::instance() {
}

StatsMgr::StatsMgr() :
global_(boost::make_shared<StatContext>()), mutex_(new mutex) {
global_(boost::make_shared<StatContext>()), mutex_(new mutex()) {
}

void
Expand Down

0 comments on commit c25bc2b

Please sign in to comment.