]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
test-iputils_hh.cc: Appease clang-tidy 16254/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 13 Oct 2025 15:21:07 +0000 (17:21 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 13 Oct 2025 15:21:07 +0000 (17:21 +0200)
Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
pdns/test-iputils_hh.cc

index 975f289b2edb29f88eda73e1b7012720846f8867..a21e826cc6b3b260ea6df06be75fa3bca6ef01dd 100644 (file)
@@ -946,19 +946,21 @@ BOOST_AUTO_TEST_CASE(test_parseIPAndPort)
 
 BOOST_AUTO_TEST_CASE(test_unspecified)
 {
-  struct {
+  struct TestParams
+  {
     std::string str;
     bool unspecified;
-  } tests[] = {
-    { "0.0.0.0:0", true },
-    { "[::]:0", true },
-    { "0.0.0.0:853", true },
-    { "[::]:853", true },
-    { "192.0.2.1:0", false },
-    { "192.0.2.1:853", false },
-    { "[2001:db8::1]:0", false },
-    { "[2001:db8::1]:853", false },
   };
+  const std::array<TestParams, 8> tests{{
+    {"0.0.0.0:0", true},
+    {"[::]:0", true},
+    {"0.0.0.0:853", true},
+    {"[::]:853", true},
+    {"192.0.2.1:0", false},
+    {"192.0.2.1:853", false},
+    {"[2001:db8::1]:0", false},
+    {"[2001:db8::1]:853", false}
+  }};
 
   for (const auto& test : tests) {
     const ComboAddress address(test.str);