Skip to content

Commit a4e24af

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

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

fs/cache/test/cache_test.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,11 @@ 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+
#if __cplusplus < 201400L
458459
std::random_shuffle(offset.begin(), offset.end());
460+
#else
461+
std::shuffle(offset.begin(), offset.end(), std::mt19937(std::random_device()()));
462+
#endif
459463
for (const auto &x : offset) {
460464
EXPECT_EQ((ssize_t)(1UL<<20), ::pread(fd, buffersrc, 1024*1024, x));
461465
f->pread(buffer, 1024*1024, x);

0 commit comments

Comments
 (0)