]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#4329] addressed review
authorRazvan Becheriu <razvan@isc.org>
Sat, 6 Jun 2026 12:54:41 +0000 (15:54 +0300)
committerRazvan Becheriu <razvan@isc.org>
Sat, 6 Jun 2026 13:10:38 +0000 (13:10 +0000)
src/bin/d2/tests/d2_queue_mgr_unittests.cc
src/bin/dhcp6/tests/config_parser_unittest.cc
src/hooks/dhcp/user_chk/tests/userid_unittests.cc
src/lib/dhcp_ddns/tests/ncr_udp_unittests.cc
src/lib/dhcp_ddns/tests/ncr_unittests.cc
src/lib/dhcpsrv/cfg_mac_source.cc
src/lib/http/tests/connection_pool_unittests.cc

index bb9eb5ca9fb86845e5e4d078a9cbd2cf5c006e1d..a8925ebdd3995c63f934709af93723e4aa97bc35 100644 (file)
@@ -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;
index 4101c5cd57dcfd0ac739ab29c170299a969d7e62..4dc3103f8866a15f589c4f5f73cf61a9b280ab50 100644 (file)
@@ -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.
index 541b1c658d1850e23d61ec924fed73bd56c951e3..bc42054bdb6657c62f01f181391fe4e1baaffab3 100644 (file)
@@ -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<uint8_t> bytes(tmp, tmp + (sizeof(tmp)/sizeof(uint8_t)));
+    std::vector<uint8_t> 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<uint8_t> bytes(tmp, tmp + (sizeof(tmp)/sizeof(uint8_t)));
+    std::vector<uint8_t> bytes(tmp, tmp + (sizeof(tmp) / sizeof(uint8_t)));
 
     // Verify construction from an DUID id type and address vector.
     UserIdPtr id;
index be43d69c3778d0e026745203b3e553f0d41edee2..1689008ecad88ff5f6b9e609f6efad2d1c98d42d 100644 (file)
@@ -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_));
index 3fe916baed3279df2aafce4abaf15106d743da88..ed06f8d0f95bd6ca66a913c0813615f999a06080 100644 (file)
@@ -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
index b4029b0e36338f638f73d5db7ea4f31ef12c3c15..24fc4f060ff444e24a262787a715cdf9da199ba1 100644 (file)
@@ -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;
index e1d8d17278bd1f895216559dfa8e4c565ceefcf9..9b1fa148e23f390782fc90d7d566c85e5b7aed30 100644 (file)
@@ -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));