From: Razvan Becheriu Date: Sat, 6 Jun 2026 12:54:41 +0000 (+0300) Subject: [#4329] addressed review X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=c74f85191d7efc420fbaf54ae1cf4989b9c85efa;p=thirdparty%2Fkea.git [#4329] addressed review --- diff --git a/src/bin/d2/tests/d2_queue_mgr_unittests.cc b/src/bin/d2/tests/d2_queue_mgr_unittests.cc index bb9eb5ca9f..a8925ebdd3 100644 --- a/src/bin/d2/tests/d2_queue_mgr_unittests.cc +++ b/src/bin/d2/tests/d2_queue_mgr_unittests.cc @@ -63,7 +63,7 @@ const char *valid_msgs[] = "}" }; -static const int VALID_MSG_CNT = sizeof(valid_msgs)/sizeof(char*); +static const int VALID_MSG_CNT = sizeof(valid_msgs) / sizeof(char*); const char* TEST_ADDRESS = "127.0.0.1"; const uint32_t LISTENER_PORT = 5301; diff --git a/src/bin/dhcp6/tests/config_parser_unittest.cc b/src/bin/dhcp6/tests/config_parser_unittest.cc index 4101c5cd57..4dc3103f88 100644 --- a/src/bin/dhcp6/tests/config_parser_unittest.cc +++ b/src/bin/dhcp6/tests/config_parser_unittest.cc @@ -2841,7 +2841,7 @@ TEST_F(Dhcp6ParserTest, invalidPdPools) { }; ConstElementPtr json; - size_t num_msgs = sizeof(config)/sizeof(char*); + size_t num_msgs = sizeof(config) / sizeof(char*); for (size_t i = 0; i < num_msgs; i++) { // Convert JSON string to Elements. // The 3 first configs should fail to parse. diff --git a/src/hooks/dhcp/user_chk/tests/userid_unittests.cc b/src/hooks/dhcp/user_chk/tests/userid_unittests.cc index 541b1c658d..bc42054bdb 100644 --- a/src/hooks/dhcp/user_chk/tests/userid_unittests.cc +++ b/src/hooks/dhcp/user_chk/tests/userid_unittests.cc @@ -41,7 +41,7 @@ TEST(UserIdTest, hwAddress_type) { // Build a test address vector. uint8_t tmp[] = { 0x01, 0xFF, 0x02, 0xAC, 0x03, 0x0B, 0x07, 0x08 }; - std::vector bytes(tmp, tmp + (sizeof(tmp)/sizeof(uint8_t))); + std::vector bytes(tmp, tmp + (sizeof(tmp) / sizeof(uint8_t))); // Verify construction from an HW_ADDRESS id type and address vector. UserIdPtr id; @@ -89,7 +89,7 @@ TEST(UserIdTest, duid_type) { // Build a test DUID vector. uint8_t tmp[] = { 0x01, 0xFF, 0x02, 0xAC, 0x03, 0x0B, 0x07, 0x08 }; - std::vector bytes(tmp, tmp + (sizeof(tmp)/sizeof(uint8_t))); + std::vector bytes(tmp, tmp + (sizeof(tmp) / sizeof(uint8_t))); // Verify construction from an DUID id type and address vector. UserIdPtr id; diff --git a/src/lib/dhcp_ddns/tests/ncr_udp_unittests.cc b/src/lib/dhcp_ddns/tests/ncr_udp_unittests.cc index be43d69c37..1689008eca 100644 --- a/src/lib/dhcp_ddns/tests/ncr_udp_unittests.cc +++ b/src/lib/dhcp_ddns/tests/ncr_udp_unittests.cc @@ -249,7 +249,7 @@ TEST_F(NameChangeUDPListenerTest, basicReceiveTests) { // Iterate over a series of requests, sending and receiving one /// at time. - size_t num_msgs = sizeof(valid_msgs)/sizeof(char*); + size_t num_msgs = sizeof(valid_msgs) / sizeof(char*); for (size_t i = 0; i < num_msgs; ++i) { // We are not verifying ability to send, so if we can't test is over. ASSERT_NO_THROW(sendNcr(valid_msgs[i])); @@ -387,7 +387,7 @@ TEST_F(NameChangeUDPSenderBasicTest, basicSendTests) { SimpleSendHandlerPtr ncr_handler(new SimpleSendHandler()); // Tests are based on a list of messages, get the count now. - size_t num_msgs = sizeof(valid_msgs)/sizeof(char*); + size_t num_msgs = sizeof(valid_msgs) / sizeof(char*); // Create the sender, setting the queue max equal to the number of // messages we will have in the list. @@ -515,7 +515,7 @@ TEST_F(NameChangeUDPSenderBasicTest, basicSendTestsMultiThreading) { SimpleSendHandlerPtr ncr_handler(new SimpleSendHandler()); // Tests are based on a list of messages, get the count now. - size_t num_msgs = sizeof(valid_msgs)/sizeof(char*); + size_t num_msgs = sizeof(valid_msgs) / sizeof(char*); // Create the sender, setting the queue max equal to the number of // messages we will have in the list. @@ -641,7 +641,7 @@ TEST_F(NameChangeUDPSenderBasicTest, autoStart) { SimpleSendHandlerPtr ncr_handler(new SimpleSendHandler()); // Tests are based on a list of messages, get the count now. - size_t num_msgs = sizeof(valid_msgs)/sizeof(char*); + size_t num_msgs = sizeof(valid_msgs) / sizeof(char*); // Create the sender, setting the queue max equal to the number of // messages we will have in the list. @@ -696,7 +696,7 @@ TEST_F(NameChangeUDPSenderBasicTest, autoStartMultiThreading) { SimpleSendHandlerPtr ncr_handler(new SimpleSendHandler()); // Tests are based on a list of messages, get the count now. - size_t num_msgs = sizeof(valid_msgs)/sizeof(char*); + size_t num_msgs = sizeof(valid_msgs) / sizeof(char*); // Create the sender, setting the queue max equal to the number of // messages we will have in the list. @@ -748,7 +748,7 @@ TEST_F(NameChangeUDPSenderBasicTest, anyAddressSend) { SimpleSendHandlerPtr ncr_handler(new SimpleSendHandler()); // Tests are based on a list of messages, get the count now. - size_t num_msgs = sizeof(valid_msgs)/sizeof(char*); + size_t num_msgs = sizeof(valid_msgs) / sizeof(char*); // Create the sender, setting the queue max equal to the number of // messages we will have in the list. @@ -786,7 +786,7 @@ TEST_F(NameChangeUDPSenderBasicTest, anyAddressSendMultiThreading) { SimpleSendHandlerPtr ncr_handler(new SimpleSendHandler()); // Tests are based on a list of messages, get the count now. - size_t num_msgs = sizeof(valid_msgs)/sizeof(char*); + size_t num_msgs = sizeof(valid_msgs) / sizeof(char*); // Create the sender, setting the queue max equal to the number of // messages we will have in the list. @@ -822,7 +822,7 @@ TEST_F(NameChangeUDPSenderBasicTest, assumeQueue) { NameChangeRequestPtr ncr; // Tests are based on a list of messages, get the count now. - size_t num_msgs = sizeof(valid_msgs)/sizeof(char*); + size_t num_msgs = sizeof(valid_msgs) / sizeof(char*); // Create two senders with queue max equal to the number of // messages we will have in the list. @@ -894,7 +894,7 @@ TEST_F(NameChangeUDPSenderBasicTest, assumeQueueMultiThreading) { NameChangeRequestPtr ncr; // Tests are based on a list of messages, get the count now. - size_t num_msgs = sizeof(valid_msgs)/sizeof(char*); + size_t num_msgs = sizeof(valid_msgs) / sizeof(char*); // Create two senders with queue max equal to the number of // messages we will have in the list. @@ -1104,7 +1104,7 @@ TEST_F(NameChangeUDPTest, roundTripTest) { EXPECT_TRUE(listener_->amListening()); // Get the number of messages in the list of test messages. - size_t num_msgs = sizeof(valid_msgs)/sizeof(char*); + size_t num_msgs = sizeof(valid_msgs) / sizeof(char*); // Place the sender into sending state. ASSERT_NO_THROW(sender_->startSending(io_service_)); @@ -1158,7 +1158,7 @@ TEST_F(NameChangeUDPTest, roundTripTestMultiThreading) { EXPECT_TRUE(listener_->amListening()); // Get the number of messages in the list of test messages. - size_t num_msgs = sizeof(valid_msgs)/sizeof(char*); + size_t num_msgs = sizeof(valid_msgs) / sizeof(char*); // Place the sender into sending state. ASSERT_NO_THROW(sender_->startSending(io_service_)); diff --git a/src/lib/dhcp_ddns/tests/ncr_unittests.cc b/src/lib/dhcp_ddns/tests/ncr_unittests.cc index 3fe916baed..ed06f8d0f9 100644 --- a/src/lib/dhcp_ddns/tests/ncr_unittests.cc +++ b/src/lib/dhcp_ddns/tests/ncr_unittests.cc @@ -583,7 +583,7 @@ TEST(NameChangeRequestTest, basicJsonTest) { TEST(NameChangeRequestTest, invalidMsgChecks) { // Iterate over the list of JSON strings, attempting to create a // NameChangeRequest. The attempt should throw a NcrMessageError. - int num_msgs = sizeof(invalid_msgs)/sizeof(char*); + int num_msgs = sizeof(invalid_msgs) / sizeof(char*); for (int i = 0; i < num_msgs; i++) { EXPECT_THROW(NameChangeRequest::fromJSON(invalid_msgs[i]), NcrMessageError) << "Invalid message not caught idx: " @@ -604,7 +604,7 @@ TEST(NameChangeRequestTest, invalidMsgChecks) { TEST(NameChangeRequestTest, validMsgChecks) { // Iterate over the list of JSON strings, attempting to create a // NameChangeRequest. The attempt should succeed. - int num_msgs = sizeof(valid_msgs)/sizeof(char*); + int num_msgs = sizeof(valid_msgs) / sizeof(char*); for (int i = 0; i < num_msgs; i++) { EXPECT_NO_THROW(NameChangeRequest::fromJSON(valid_msgs[i])) << "Valid message failed, message idx: " << i diff --git a/src/lib/dhcpsrv/cfg_mac_source.cc b/src/lib/dhcpsrv/cfg_mac_source.cc index b4029b0e36..24fc4f060f 100644 --- a/src/lib/dhcpsrv/cfg_mac_source.cc +++ b/src/lib/dhcpsrv/cfg_mac_source.cc @@ -45,7 +45,7 @@ CfgMACSource::CfgMACSource() { } uint32_t CfgMACSource::MACSourceFromText(const std::string& name) { - for (unsigned i = 0; i < sizeof(sources)/sizeof(sources[0]); ++i) { + for (unsigned i = 0; i < sizeof(sources) / sizeof(sources[0]); ++i) { if (name.compare(sources[i].name) == 0) { return (sources[i].type); } @@ -68,7 +68,7 @@ ElementPtr CfgMACSource::toElement() const { ElementPtr result = Element::createList(); for (auto const& source : mac_sources_) { std::string name; - for (unsigned i = 0; i < sizeof(sources)/sizeof(sources[0]); ++i) { + for (unsigned i = 0; i < sizeof(sources) / sizeof(sources[0]); ++i) { if (sources[i].type == source) { name = sources[i].name; break; diff --git a/src/lib/http/tests/connection_pool_unittests.cc b/src/lib/http/tests/connection_pool_unittests.cc index e1d8d17278..9b1fa148e2 100644 --- a/src/lib/http/tests/connection_pool_unittests.cc +++ b/src/lib/http/tests/connection_pool_unittests.cc @@ -148,12 +148,12 @@ public: // Start second connection and check that it also has been added. ASSERT_NO_THROW(pool.start(conn2)); ASSERT_EQ(2U, pool.connections_.size()); - ASSERT_TRUE( pool.hasConnection(conn2)); + ASSERT_TRUE(pool.hasConnection(conn2)); // Stop first connection. ASSERT_NO_THROW(pool.stop(conn1)); ASSERT_EQ(1U, pool.connections_.size()); - // Check thaUt it has been removed but the second connection is still + // Check that it has been removed but the second connection is still // there. ASSERT_FALSE(pool.hasConnection(conn1)); ASSERT_TRUE(pool.hasConnection(conn2));