Loading tests/unit/helpers/random_string.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -41,7 +41,7 @@ random_string(std::size_t length) { thread_local static std::mt19937 rng{std::random_device{}()}; thread_local static std::uniform_int_distribution<std::string::size_type> pick(0, std::size(charset) - 1); pick(0, std::size(charset) - 2); std::string s(length, '\0'); Loading tests/unit/test_helpers.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -45,10 +45,11 @@ SCENARIO("random strings can be generated", "[test_helpers][random_string]") { WHEN("Length is a positive integer") { const auto s = helpers::random_string(6); const std::size_t n = GENERATE(range(1, 5432)); const auto s = helpers::random_string(n); THEN(" The generated string is empty ") { REQUIRE(s.length() == 6); REQUIRE(s.length() == n); } } } Loading Loading
tests/unit/helpers/random_string.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -41,7 +41,7 @@ random_string(std::size_t length) { thread_local static std::mt19937 rng{std::random_device{}()}; thread_local static std::uniform_int_distribution<std::string::size_type> pick(0, std::size(charset) - 1); pick(0, std::size(charset) - 2); std::string s(length, '\0'); Loading
tests/unit/test_helpers.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -45,10 +45,11 @@ SCENARIO("random strings can be generated", "[test_helpers][random_string]") { WHEN("Length is a positive integer") { const auto s = helpers::random_string(6); const std::size_t n = GENERATE(range(1, 5432)); const auto s = helpers::random_string(n); THEN(" The generated string is empty ") { REQUIRE(s.length() == 6); REQUIRE(s.length() == n); } } } Loading