diff options
author | Tor Egge <Tor.Egge@online.no> | 2022-06-02 16:35:21 +0200 |
---|---|---|
committer | Tor Egge <Tor.Egge@online.no> | 2022-06-02 19:22:21 +0200 |
commit | 914317d3db05758483eaea09a60ef8bfa3981948 (patch) | |
tree | 7b94d14f6215b8b66becb869e1b08c59d81a05e6 /searchcore/src/tests/proton/documentdb | |
parent | a51340034f1b4bc98096613af8f5736a2c974c96 (diff) |
Remove most use of vespalib::rmdir in searchcore.
Diffstat (limited to 'searchcore/src/tests/proton/documentdb')
3 files changed, 14 insertions, 13 deletions
diff --git a/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp b/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp index 948c9cfe25e..b57ff052e82 100644 --- a/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp +++ b/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp @@ -26,10 +26,10 @@ #include <vespa/searchlib/attribute/interlock.h> #include <vespa/searchlib/index/dummyfileheadercontext.h> #include <vespa/searchlib/transactionlog/nosyncproxy.h> -#include <vespa/vespalib/io/fileutil.h> #include <vespa/vespalib/util/size_literals.h> #include <vespa/vespalib/util/testclock.h> #include <vespa/vespalib/util/threadstackexecutor.h> +#include <filesystem> using namespace config; using namespace document; @@ -173,8 +173,8 @@ Fixture::Fixture() _resolver(), _configurer() { - vespalib::rmdir(BASE_DIR, true); - vespalib::mkdir(BASE_DIR); + std::filesystem::remove_all(std::filesystem::path(BASE_DIR)); + std::filesystem::create_directory(std::filesystem::path(BASE_DIR)); initViewSet(_views); _configurer = std::make_unique<Configurer>(_views._summaryMgr, _views.searchView, _views.feedView, _queryLimiter, _constantValueRepo, _clock.clock(), "test", 0); @@ -284,8 +284,8 @@ struct FastAccessFixture _view(_service.write()), _configurer(_view._feedView, std::make_unique<AttributeWriterFactory>(), "test") { - vespalib::rmdir(BASE_DIR, true); - vespalib::mkdir(BASE_DIR); + std::filesystem::remove_all(std::filesystem::path(BASE_DIR)); + std::filesystem::create_directory(std::filesystem::path(BASE_DIR)); } ~FastAccessFixture() { _service.shutdown(); @@ -692,5 +692,5 @@ TEST("require that subdbs should change if relevant config changed") TEST_MAIN() { TEST_RUN_ALL(); - vespalib::rmdir(BASE_DIR, true); + std::filesystem::remove_all(std::filesystem::path(BASE_DIR)); } diff --git a/searchcore/src/tests/proton/documentdb/documentdb_test.cpp b/searchcore/src/tests/proton/documentdb/documentdb_test.cpp index a9f923833e5..916f3106923 100644 --- a/searchcore/src/tests/proton/documentdb/documentdb_test.cpp +++ b/searchcore/src/tests/proton/documentdb/documentdb_test.cpp @@ -36,6 +36,7 @@ #include <vespa/vespalib/stllike/asciistream.h> #include <vespa/vespalib/testkit/test_kit.h> #include <vespa/vespalib/util/size_literals.h> +#include <filesystem> #include <iostream> using namespace cloud::config::filedistribution; @@ -62,10 +63,10 @@ namespace { void cleanup_dirs(bool file_config) { - vespalib::rmdir("typea", true); - vespalib::rmdir("tmp", true); + std::filesystem::remove_all(std::filesystem::path("typea")); + std::filesystem::remove_all(std::filesystem::path("tmp")); if (file_config) { - vespalib::rmdir("config", true); + std::filesystem::remove_all(std::filesystem::path("config")); } } @@ -105,7 +106,7 @@ FixtureBase::FixtureBase(bool file_config) : _cleanup(true), _file_config(file_config) { - vespalib::mkdir("typea"); + std::filesystem::create_directory(std::filesystem::path("typea")); } @@ -352,7 +353,7 @@ TEST("require that resume after interrupted save config works") std::cout << "Best config serial is " << best_config_snapshot.syncToken << std::endl; auto old_config_subdir = config_subdir(best_config_snapshot.syncToken); auto new_config_subdir = config_subdir(serialNum + 1); - vespalib::mkdir(new_config_subdir); + std::filesystem::create_directories(std::filesystem::path(new_config_subdir)); auto config_files = vespalib::listDirectory(old_config_subdir); for (auto &config_file : config_files) { vespalib::copy(old_config_subdir + "/" + config_file, new_config_subdir + "/" + config_file, false, false); diff --git a/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp b/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp index 8ef2742b6d8..f9518cb1b5e 100644 --- a/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp +++ b/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp @@ -35,7 +35,7 @@ #include <vespa/vespalib/util/lambdatask.h> #include <vespa/vespalib/util/exceptions.h> #include <vespa/vespalib/util/size_literals.h> -#include <vespa/vespalib/io/fileutil.h> +#include <filesystem> #include <vespa/log/log.h> LOG_SETUP("feedhandler_test"); @@ -784,5 +784,5 @@ TEST_MAIN() { DummyFileHeaderContext::setCreator("feedhandler_test"); TEST_RUN_ALL(); - vespalib::rmdir("mytlsdir", true); + std::filesystem::remove_all(std::filesystem::path("mytlsdir")); } |