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);