Skip to content

Commit 240c3bf

Browse files
committed
Perform non-deterministic randomized testing for sorting
1 parent a5e3485 commit 240c3bf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/c++/itertools.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,8 +373,8 @@ TEST(Itertools, RangeRandomAccessOperations) {
373373

374374
// Create and fill a container of size n with random integers in [a,b].
375375
template <typename C> auto random_int_range(std::size_t n, int a, int b) {
376-
static std::default_random_engine eng{0x12345678};
377-
auto cont = C(n);
376+
static std::default_random_engine eng{std::random_device{}()};
377+
auto cont = C(std::uniform_int_distribution<std::size_t>(0, n)(eng));
378378
std::ranges::generate(cont, [&]() { return std::uniform_int_distribution<typename C::value_type>(a, b)(eng); });
379379
return cont;
380380
}

0 commit comments

Comments
 (0)