Skip to content

Commit a42e379

Browse files
committed
Fix compile cache test with C++17 or above, since std::random_shuffle has been removed
1 parent 060c96a commit a42e379

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/cache/test/cache_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ void* worker(void* arg) {
455455
auto f = fs->open("/huge", O_RDONLY);
456456
DEFER(delete f);
457457
for (int i=0;i<4;i++) {
458-
std::random_shuffle(offset.begin(), offset.end());
458+
std::shuffle(offset.begin(), offset.end(), std::mt19937(std::random_device()()));
459459
for (const auto &x : offset) {
460460
EXPECT_EQ((ssize_t)(1UL<<20), ::pread(fd, buffersrc, 1024*1024, x));
461461
f->pread(buffer, 1024*1024, x);

0 commit comments

Comments
 (0)