Skip to content

Commit d0f7487

Browse files
committed
Swap out random_shuffle
1 parent 62adb50 commit d0f7487

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

cpp/arcticdb/version/test/test_sort_index.cpp

+6-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ TEST(SortIndex, Basic) {
2828
}
2929

3030
auto copy = keys_and_slices;
31-
std::random_shuffle(std::begin(keys_and_slices), std::end(keys_and_slices));
31+
std::random_device rd;
32+
std::mt19937 g(rd());
33+
std::shuffle(std::begin(keys_and_slices), std::end(keys_and_slices), g);
3234
const auto version_id = VersionId{0};
3335

3436
const IndexPartialKey& partial_key{stream_id, version_id};
@@ -69,7 +71,9 @@ TEST(SortIndex, Nonzero) {
6971
keys_and_slices.emplace_back(SliceAndKey{slice, key});
7072
}
7173

72-
std::random_shuffle(std::begin(keys_and_slices), std::end(keys_and_slices));
74+
std::random_device rd;
75+
std::mt19937 g(rd());
76+
std::shuffle(std::begin(keys_and_slices), std::end(keys_and_slices), g);
7377
const auto version_id = VersionId{0};
7478

7579
const IndexPartialKey& partial_key{stream_id, version_id};

0 commit comments

Comments
 (0)