]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3190] addressed review comments
authorRazvan Becheriu <razvan@isc.org>
Tue, 20 Feb 2024 19:44:59 +0000 (21:44 +0200)
committerRazvan Becheriu <razvan@isc.org>
Tue, 5 Mar 2024 07:50:05 +0000 (07:50 +0000)
18 files changed:
src/bin/netconf/tests/netconf_unittests.cc
src/hooks/dhcp/high_availability/tests/ha_impl_unittest.cc
src/lib/asiolink/tests/tcp_socket_unittest.cc
src/lib/cc/data.cc
src/lib/dhcp/libdhcp++.cc
src/lib/dhcp_ddns/ncr_io.cc
src/lib/dhcpsrv/testutils/generic_cb_recovery_unittest.cc
src/lib/dhcpsrv/testutils/generic_host_data_source_unittest.cc
src/lib/dhcpsrv/testutils/generic_lease_mgr_unittest.cc
src/lib/dns/master_lexer.cc
src/lib/dns/messagerenderer.cc
src/lib/dns/rdata/generic/opt_41.cc
src/lib/dns/rdataclass.cc
src/lib/dns/tests/rrparamregistry_unittest.cc
src/lib/dns/tsigkey.cc
src/lib/process/tests/d_cfg_mgr_unittests.cc
src/lib/process/tests/daemon_unittest.cc
src/lib/stats/stats_mgr.cc

index 989034028fb993bd41bdac2160898c8714677fdd..7f211539a1c5abb1d64bf4f7be4fb7a1f4cce45e 100644 (file)
@@ -193,7 +193,7 @@ public:
         : finished_(false),
           io_service_(new IOService()),
           thread_(),
-          agent_(new NakedNetconfAgent) {
+          agent_(new NakedNetconfAgent()) {
     }
 
     /// @brief Destructor.
index 4f7eb1a5a30615417959e079bb68ab74aa172cfb..b509ac1e6c88c4f057968efc73529d9f5ebded36 100644 (file)
@@ -103,7 +103,7 @@ public:
     /// @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()));
 
index b5b2c6e9d69f1a2fc3640d27aebc67aeef8f3406..1f2ff42b4f6a1daa9a9ab4474dfa594a6ac97564 100644 (file)
@@ -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));
index 93308937b9aea71636e29d69ecafee46c3678a4d..3fb117ac0fe050b62219c0b9a829ff7d391b852d 100644 (file)
@@ -1361,7 +1361,7 @@ mergeDiffDel(ElementPtr& element, ElementPtr& other,
         }
         return;
     }
-    element = ElementPtr(new NullElement);
+    element = ElementPtr(new NullElement());
 }
 
 void
index 1f5316ff9ff99df3c401d286a87c4cd6678cc54a..8e5b794be409f80cd6f08b75138ab8b97031aef2 100644 (file)
@@ -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);
index 48f220f0526fb67bafe6481de2d39ccb1e144373..a48613b0b71700fa82eb1fe353594aadc1e5d596 100644 (file)
@@ -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);
index 8f4e8ba00a4fbf2e69363fbd9ea7cbafab66e571..0fa64b369bd0c94d04acf8062dddbc42b05a4570 100644 (file)
@@ -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);
@@ -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);
@@ -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);
@@ -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);
index e1b4aad01d75c750bbf54695677a666f7046df6e..e590dbfb415e6561a238b43858aceb5f631ce74c 100644 (file)
@@ -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();
@@ -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();
@@ -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();
@@ -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();
index 4ecd933509967e2ffa60bfed948f8ef48b7ffdb5..475af5fd0ec37a6104e8a0daef76cee9fdf00d60 100644 (file)
@@ -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);
@@ -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);
@@ -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);
@@ -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);
index de598e4860e77efcd729491867dc2ebc10a6326a..8853a168ea512b3e4380139377a304f8635fa032 100644 (file)
@@ -126,7 +126,7 @@ struct MasterLexer::MasterLexerImpl {
     bool previous_was_eol_;
 };
 
-MasterLexer::MasterLexer() : impl_(new MasterLexerImpl) {
+MasterLexer::MasterLexer() : impl_(new MasterLexerImpl()) {
 }
 
 MasterLexer::~MasterLexer() {
index 81b2c92dd234ccc280323f8fbed175b280bfc581..5c84f78244dbd48ad7341f2aeb72d54dece1be87 100644 (file)
@@ -220,8 +220,8 @@ struct MessageRenderer::MessageRendererImpl {
 
 MessageRenderer::MessageRenderer() :
     AbstractMessageRenderer(),
-    impl_(new MessageRendererImpl)
-{}
+    impl_(new MessageRendererImpl()) {
+}
 
 MessageRenderer::~MessageRenderer() {
     delete impl_;
index 4be20a41c3652db2fd81c0a7b5cbe590d01ddd6c..326ec383ab5d6963d840e7f5a4d76db0d77146de 100644 (file)
@@ -54,7 +54,7 @@ struct OPTImpl {
 
 /// \brief Default constructor.
 OPT::OPT() :
-    impl_(new OPTImpl)
+    impl_(new OPTImpl())
 {
 }
 
@@ -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) {
index d9cb93f50c3933e2b4fed88bc35b8b040596d954..f41db8da62c41f01a1784e85d213a6ed4a8e2386 100644 (file)
@@ -3689,7 +3689,7 @@ struct OPTImpl {
 
 /// \brief Default constructor.
 OPT::OPT() :
-    impl_(new OPTImpl)
+    impl_(new OPTImpl())
 {
 }
 
@@ -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) {
index 90574d095d7d3c1fea0c3bac4138dcec5f042f5d..cd14d14180a3b444ff7ea7a6251e66854e5a58f8 100644 (file)
@@ -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(
@@ -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"),
@@ -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;
index a32d8c92460d1193ccb07eb20135af229b234884..f80d0b86b369d48974e7bb16f16b131bf28a6b56 100644 (file)
@@ -311,7 +311,7 @@ struct TSIGKeyRing::TSIGKeyRingImpl {
     TSIGKeyMap keys;
 };
 
-TSIGKeyRing::TSIGKeyRing() : impl_(new TSIGKeyRingImpl) {
+TSIGKeyRing::TSIGKeyRing() : impl_(new TSIGKeyRingImpl()) {
 }
 
 TSIGKeyRing::~TSIGKeyRing() {
index 4651a19fbac7bd7ee9455369271a88b0383cb641..7cfa746a857999d43aecc9e129f366e454a81980 100644 (file)
@@ -59,7 +59,7 @@ class DStubCfgMgrTest : public ConfigParseTest {
 public:
 
     /// @brief Constructor
-    DStubCfgMgrTest():cfg_mgr_(new DStubCfgMgr) {
+    DStubCfgMgrTest():cfg_mgr_(new DStubCfgMgr()) {
     }
 
     /// @brief Destructor
index fcb5a9a41f4ed7f364b7aa9563cfd11174468a7b..121c530319d660bd6613003c74facb7f6298d77c 100644 (file)
@@ -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");
index b420cabc8260c98d22806d8a32e98136f11de464..99805c778ceedcbc11ae188e25cc01e9cf7ee51d 100644 (file)
@@ -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