Copilot commented on code in PR #3608:
URL: https://github.com/apache/brpc/pull/3608#discussion_r4290662370


##########
test/brpc_naming_service_unittest.cpp:
##########
@@ -289,6 +289,18 @@ TEST(NamingServiceTest, remotefile) {
     }
 }
 
+TEST(NamingServiceTest, remotefile_invalid_url) {
+    const char* service_names[] = {
+        "http://";, "bns://", "http:////";
+    };
+    for (size_t i = 0; i < ARRAY_SIZE(service_names); ++i) {
+        brpc::policy::RemoteFileNamingService rfns;
+        std::vector<brpc::ServerNode> servers;
+        EXPECT_EQ(-1, rfns.GetServers(service_names[i], &servers));

Review Comment:
   Nit: This loop can be simplified with a range-based for (e.g., `for (const 
auto* name : service_names)`) to avoid manual indexing and `ARRAY_SIZE`, which 
reduces opportunities for indexing mistakes and keeps the test more readable.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to