diff options
author | Tor Egge <Tor.Egge@online.no> | 2023-08-30 16:17:11 +0200 |
---|---|---|
committer | Tor Egge <Tor.Egge@online.no> | 2023-08-30 16:17:11 +0200 |
commit | 1aaa001b5680225a4f92f3f52804a482b4a69338 (patch) | |
tree | bd171935991035f01e7de5b46bc132e4587bb925 /searchcore | |
parent | 6661965c41d2d5ad0ed0be931140cff10d193bff (diff) |
Use std::filesystem::directory_iterator in disk index cleaner unit test.
Diffstat (limited to 'searchcore')
-rw-r--r-- | searchcore/src/tests/proton/index/diskindexcleaner_test.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/searchcore/src/tests/proton/index/diskindexcleaner_test.cpp b/searchcore/src/tests/proton/index/diskindexcleaner_test.cpp index e8926a957b7..1be97e3c981 100644 --- a/searchcore/src/tests/proton/index/diskindexcleaner_test.cpp +++ b/searchcore/src/tests/proton/index/diskindexcleaner_test.cpp @@ -63,13 +63,12 @@ void createIndex(const string &name) { vector<string> readIndexes() { vector<string> indexes; - FastOS_DirectoryScan dir_scan(index_dir.c_str()); - while (dir_scan.ReadNext()) { - string name = dir_scan.GetName(); - if (!dir_scan.IsDirectory() || name.find("index.") != 0) { + std::filesystem::directory_iterator dir_scan(index_dir); + for (auto entry : dir_scan) { + if (!entry.is_directory() || entry.path().filename().string().find("index.") != 0) { continue; } - indexes.push_back(name); + indexes.push_back(entry.path().filename().string()); } return indexes; } |