Skip to content

Commit

Permalink
ensure exact iteration count
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesnicholson committed Dec 30, 2023
1 parent cb649b9 commit 0c8de95
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions tests/test_many_random_payloads.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ TEST_CASE("many random payloads") {
std::mt19937 mt{ seed }; // deterministic
byte_vec_t source(LEN), decoded(LEN), encoded(COBS_ENCODE_MAX(LEN));

while (s_iterations > 0) {
while (--s_iterations > 0) {
std::generate(source.begin(), source.end(), [&]() { return byte_t(mt() & 0xFF); });
memset(source.data() + 1000, 0xAA, 256 * 10); // nonzero run

Expand All @@ -45,7 +45,6 @@ TEST_CASE("many random payloads") {

REQUIRE(dec_len == LEN);
REQUIRE(source == decoded);
--s_iterations;
}
} };

Expand Down

0 comments on commit 0c8de95

Please sign in to comment.