From 5e75be202864444d13e425b727428b06c5d21a51 Mon Sep 17 00:00:00 2001 From: Greg Gauthier Date: Fri, 5 Sep 2025 12:51:09 +0100 Subject: [PATCH] make tests more syntactically conformant --- tests/passwdgen_test.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/passwdgen_test.cpp b/tests/passwdgen_test.cpp index 7f5f645..19006cb 100644 --- a/tests/passwdgen_test.cpp +++ b/tests/passwdgen_test.cpp @@ -5,9 +5,7 @@ #include void test_random_string_length() { - const int lengths[] = {0, 1, 10, 32, 100}; - - for (auto length : lengths) { + for (const int lengths[] = {0, 1, 10, 32, 100}; const auto length : lengths) { std::string result = random_string(length, false); assert(result.length() == length); @@ -18,7 +16,7 @@ void test_random_string_length() { } void test_alphanumeric_only() { - std::regex alphanumeric_only("^[a-zA-Z0-9]*$"); + const std::regex alphanumeric_only("^[a-zA-Z0-9]*$"); for (int i = 0; i < 10; i++) { std::string result = random_string(20, false);