diff --git a/Tests/BaseLib/TestAlgorithm.cpp b/Tests/BaseLib/TestAlgorithm.cpp index 9fa7d72abe6..d102cb726cc 100644 --- a/Tests/BaseLib/TestAlgorithm.cpp +++ b/Tests/BaseLib/TestAlgorithm.cpp @@ -9,6 +9,7 @@ #include #include +#include #include #include @@ -19,12 +20,13 @@ TEST(BaseLibAlgorithm, testreorderVector) { const std::size_t size = 100; std::vector vec(size); - std::generate(vec.begin(), vec.end(), std::rand); + std::default_random_engine random_engine; + std::generate(vec.begin(), vec.end(), random_engine); std::vector vec0 = vec; std::vector order(size); std::iota(order.begin(), order.end(), 0); - std::random_shuffle(order.begin(), order.end()); + std::shuffle(order.begin(), order.end(), random_engine); BaseLib::reorderVector(vec, order);