test fixes

This commit is contained in:
Scott E. Graves 2024-08-02 15:10:59 -05:00
parent 88c7e7f192
commit 89cd8c8fd0
10 changed files with 60 additions and 60 deletions

View File

@ -48,13 +48,13 @@ protected:
if (PROVIDER_INDEX != 0) { if (PROVIDER_INDEX != 0) {
if (PROVIDER_INDEX == 1) { if (PROVIDER_INDEX == 1) {
EXPECT_TRUE(utils::file::delete_directory_recursively( EXPECT_TRUE(utils::file::delete_directory_recursively(
"./winfsp_test" + std::to_string(PROVIDER_INDEX))); "./test_config/winfsp_test" + std::to_string(PROVIDER_INDEX)));
app_config src_cfg(provider_type::s3, app_config src_cfg(provider_type::s3,
utils::path::combine(get_test_dir(), {"storj"})); utils::path::combine(get_test_dir(), {"storj"}));
config = std::make_unique<app_config>( config = std::make_unique<app_config>(
provider_type::s3, provider_type::s3,
"./winfsp_test" + std::to_string(PROVIDER_INDEX)); "./test_config/winfsp_test" + std::to_string(PROVIDER_INDEX));
EXPECT_FALSE(config EXPECT_FALSE(config
->set_value_by_name("S3Config.AccessKey", ->set_value_by_name("S3Config.AccessKey",
src_cfg.get_s3_config().access_key) src_cfg.get_s3_config().access_key)
@ -90,13 +90,13 @@ protected:
if (PROVIDER_INDEX == 2) { if (PROVIDER_INDEX == 2) {
EXPECT_TRUE(utils::file::delete_directory_recursively( EXPECT_TRUE(utils::file::delete_directory_recursively(
"./winfsp_test" + std::to_string(PROVIDER_INDEX))); "./test_config/winfsp_test" + std::to_string(PROVIDER_INDEX)));
app_config src_cfg(provider_type::sia, app_config src_cfg(provider_type::sia,
utils::path::combine(get_test_dir(), {"sia"})); utils::path::combine(get_test_dir(), {"sia"}));
config = std::make_unique<app_config>( config = std::make_unique<app_config>(
provider_type::sia, provider_type::sia,
"./winfsp_test" + std::to_string(PROVIDER_INDEX)); "./test_config/winfsp_test" + std::to_string(PROVIDER_INDEX));
[[maybe_unused]] auto val = config->set_value_by_name( [[maybe_unused]] auto val = config->set_value_by_name(
"HostConfig.AgentString", src_cfg.get_host_config().agent_string); "HostConfig.AgentString", src_cfg.get_host_config().agent_string);
EXPECT_FALSE( EXPECT_FALSE(
@ -136,7 +136,7 @@ protected:
event_system::instance().stop(); event_system::instance().stop();
EXPECT_TRUE(utils::file::delete_directory_recursively( EXPECT_TRUE(utils::file::delete_directory_recursively(
"./winfsp_test" + std::to_string(PROVIDER_INDEX))); "./test_config/winfsp_test" + std::to_string(PROVIDER_INDEX)));
} }
} }
}; };

View File

@ -33,20 +33,20 @@ public:
static console_consumer cs; static console_consumer cs;
std::string s3_directory{ std::string s3_directory{
utils::path::combine(get_test_dir(), {"config_test", "s3"})}; utils::path::combine("./test_config", {"config_test", "s3"})};
std::string sia_directory{ std::string sia_directory{
utils::path::combine(get_test_dir(), {"config_test", "sia"})}; utils::path::combine("./test_config", {"config_test", "sia"})};
void SetUp() override { void SetUp() override {
event_system::instance().start(); event_system::instance().start();
ASSERT_TRUE(utils::file::delete_directory_recursively( ASSERT_TRUE(utils::file::delete_directory_recursively(
utils::path::combine(get_test_dir(), {"config_test"}))); utils::path::combine("./test_config", {"config_test"})));
} }
void TearDown() override { void TearDown() override {
ASSERT_TRUE(utils::file::delete_directory_recursively( ASSERT_TRUE(utils::file::delete_directory_recursively(
utils::path::combine(get_test_dir(), {"config_test"}))); utils::path::combine("./test_config", {"config_test"})));
event_system::instance().stop(); event_system::instance().stop();
} }
}; };

View File

@ -55,7 +55,7 @@ static void validate_write(file_manager::open_file &o, std::size_t offset,
TEST(open_file, properly_initializes_state_for_0_byte_file) { TEST(open_file, properly_initializes_state_for_0_byte_file) {
const auto source_path = const auto source_path =
generate_test_file_name(get_test_dir(), "file_manager_open_file_test"); generate_test_file_name("./test_config", "file_manager_open_file_test");
mock_provider mp; mock_provider mp;
mock_upload_manager um; mock_upload_manager um;
@ -76,7 +76,7 @@ TEST(open_file, properly_initializes_state_for_0_byte_file) {
TEST(open_file, properly_initializes_state_based_on_chunk_size) { TEST(open_file, properly_initializes_state_based_on_chunk_size) {
const auto source_path = const auto source_path =
generate_test_file_name(get_test_dir(), "file_manager_open_file_test"); generate_test_file_name("./test_config", "file_manager_open_file_test");
mock_provider mp; mock_provider mp;
mock_upload_manager um; mock_upload_manager um;
@ -109,7 +109,7 @@ TEST(open_file, properly_initializes_state_based_on_chunk_size) {
TEST(open_file, will_not_change_source_path_for_0_byte_file) { TEST(open_file, will_not_change_source_path_for_0_byte_file) {
const auto source_path = const auto source_path =
generate_test_file_name(get_test_dir(), "file_manager_open_file_test"); generate_test_file_name("./test_config", "file_manager_open_file_test");
mock_provider mp; mock_provider mp;
mock_upload_manager um; mock_upload_manager um;
@ -133,7 +133,7 @@ TEST(open_file, will_not_change_source_path_for_0_byte_file) {
TEST(open_file, will_change_source_path_if_file_size_is_greater_than_0) { TEST(open_file, will_change_source_path_if_file_size_is_greater_than_0) {
const auto source_path = const auto source_path =
generate_test_file_name(get_test_dir(), "file_manager_open_file_test"); generate_test_file_name("./test_config", "file_manager_open_file_test");
mock_provider mp; mock_provider mp;
mock_upload_manager um; mock_upload_manager um;
@ -172,7 +172,7 @@ TEST(open_file, will_change_source_path_if_file_size_is_greater_than_0) {
TEST(open_file, TEST(open_file,
will_not_change_source_path_if_file_size_matches_existing_source) { will_not_change_source_path_if_file_size_matches_existing_source) {
const auto source_path = const auto source_path =
generate_test_file_name(get_test_dir(), "file_manager_open_file_test"); generate_test_file_name("./test_config", "file_manager_open_file_test");
create_random_file(source_path, test_chunk_size)->close(); create_random_file(source_path, test_chunk_size)->close();
mock_provider mp; mock_provider mp;
@ -197,9 +197,9 @@ TEST(open_file,
TEST(open_file, write_with_incomplete_download) { TEST(open_file, write_with_incomplete_download) {
const auto source_path = const auto source_path =
generate_test_file_name(get_test_dir(), "file_manager_open_file_test"); generate_test_file_name("./test_config", "file_manager_open_file_test");
auto nf = create_random_file( auto nf = create_random_file(
generate_test_file_name(get_test_dir(), "file_manager_open_file_test"), generate_test_file_name("./test_config", "file_manager_open_file_test"),
test_chunk_size * 2u); test_chunk_size * 2u);
mock_provider mp; mock_provider mp;
@ -289,7 +289,7 @@ TEST(open_file, write_with_incomplete_download) {
TEST(open_file, write_new_file) { TEST(open_file, write_new_file) {
const auto source_path = const auto source_path =
generate_test_file_name(get_test_dir(), "file_manager_open_file_test"); generate_test_file_name("./test_config", "file_manager_open_file_test");
mock_provider mp; mock_provider mp;
mock_upload_manager um; mock_upload_manager um;
@ -362,7 +362,7 @@ TEST(open_file, write_new_file) {
TEST(open_file, write_new_file_multiple_chunks) { TEST(open_file, write_new_file_multiple_chunks) {
const auto source_path = const auto source_path =
generate_test_file_name(get_test_dir(), "file_manager_open_file_test"); generate_test_file_name("./test_config", "file_manager_open_file_test");
mock_provider mp; mock_provider mp;
mock_upload_manager um; mock_upload_manager um;
@ -454,7 +454,7 @@ TEST(open_file, write_new_file_multiple_chunks) {
TEST(open_file, resize_file_to_0_bytes) { TEST(open_file, resize_file_to_0_bytes) {
const auto source_path = const auto source_path =
generate_test_file_name(get_test_dir(), "file_manager_open_file_test"); generate_test_file_name("./test_config", "file_manager_open_file_test");
create_random_file(source_path, test_chunk_size * 4u)->close(); create_random_file(source_path, test_chunk_size * 4u)->close();
mock_provider mp; mock_provider mp;
@ -504,7 +504,7 @@ TEST(open_file, resize_file_to_0_bytes) {
TEST(open_file, resize_file_by_full_chunk) { TEST(open_file, resize_file_by_full_chunk) {
const auto source_path = const auto source_path =
generate_test_file_name(get_test_dir(), "file_manager_open_file_test"); generate_test_file_name("./test_config", "file_manager_open_file_test");
create_random_file(source_path, test_chunk_size * 4u)->close(); create_random_file(source_path, test_chunk_size * 4u)->close();
mock_provider mp; mock_provider mp;
@ -556,7 +556,7 @@ TEST(open_file, can_add_handle) {
event_system::instance().start(); event_system::instance().start();
console_consumer c; console_consumer c;
const auto source_path = const auto source_path =
generate_test_file_name(get_test_dir(), "file_manager_open_file_test"); generate_test_file_name("./test_config", "file_manager_open_file_test");
mock_provider mp; mock_provider mp;
mock_upload_manager um; mock_upload_manager um;
@ -618,7 +618,7 @@ TEST(open_file, can_remove_handle) {
console_consumer c; console_consumer c;
const auto source_path = const auto source_path =
generate_test_file_name(get_test_dir(), "file_manager_open_file_test"); generate_test_file_name("./test_config", "file_manager_open_file_test");
mock_provider mp; mock_provider mp;
mock_upload_manager um; mock_upload_manager um;

View File

@ -31,11 +31,11 @@
namespace repertory { namespace repertory {
static constexpr const std::size_t test_chunk_size = 1024u; static constexpr const std::size_t test_chunk_size = 1024u;
static std::string ring_buffer_dir = utils::path::combine( static std::string ring_buffer_dir = utils::path::combine(
get_test_dir(), {"file_manager_ring_buffer_open_file_test"}); "./test_config", {"file_manager_ring_buffer_open_file_test"});
TEST(ring_buffer_open_file, can_forward_to_last_chunk) { TEST(ring_buffer_open_file, can_forward_to_last_chunk) {
const auto source_path = const auto source_path =
generate_test_file_name(get_test_dir(), "ring_buffer_open_file"); generate_test_file_name("./test_config", "ring_buffer_open_file");
mock_provider mp; mock_provider mp;
@ -67,7 +67,7 @@ TEST(ring_buffer_open_file, can_forward_to_last_chunk) {
TEST(ring_buffer_open_file, TEST(ring_buffer_open_file,
can_forward_to_last_chunk_if_count_is_greater_than_remaining) { can_forward_to_last_chunk_if_count_is_greater_than_remaining) {
const auto source_path = const auto source_path =
generate_test_file_name(get_test_dir(), "ring_buffer_open_file"); generate_test_file_name("./test_config", "ring_buffer_open_file");
mock_provider mp; mock_provider mp;
@ -98,7 +98,7 @@ TEST(ring_buffer_open_file,
TEST(ring_buffer_open_file, can_forward_after_last_chunk) { TEST(ring_buffer_open_file, can_forward_after_last_chunk) {
const auto source_path = const auto source_path =
generate_test_file_name(get_test_dir(), "ring_buffer_open_file"); generate_test_file_name("./test_config", "ring_buffer_open_file");
mock_provider mp; mock_provider mp;
@ -130,7 +130,7 @@ TEST(ring_buffer_open_file, can_forward_after_last_chunk) {
TEST(ring_buffer_open_file, can_forward_and_rollover_after_last_chunk) { TEST(ring_buffer_open_file, can_forward_and_rollover_after_last_chunk) {
const auto source_path = const auto source_path =
generate_test_file_name(get_test_dir(), "ring_buffer_open_file"); generate_test_file_name("./test_config", "ring_buffer_open_file");
mock_provider mp; mock_provider mp;
@ -158,7 +158,7 @@ TEST(ring_buffer_open_file, can_forward_and_rollover_after_last_chunk) {
TEST(ring_buffer_open_file, can_reverse_to_first_chunk) { TEST(ring_buffer_open_file, can_reverse_to_first_chunk) {
const auto source_path = const auto source_path =
generate_test_file_name(get_test_dir(), "ring_buffer_open_file"); generate_test_file_name("./test_config", "ring_buffer_open_file");
mock_provider mp; mock_provider mp;
@ -190,7 +190,7 @@ TEST(ring_buffer_open_file, can_reverse_to_first_chunk) {
TEST(ring_buffer_open_file, TEST(ring_buffer_open_file,
can_reverse_to_first_chunk_if_count_is_greater_than_remaining) { can_reverse_to_first_chunk_if_count_is_greater_than_remaining) {
const auto source_path = const auto source_path =
generate_test_file_name(get_test_dir(), "ring_buffer_open_file"); generate_test_file_name("./test_config", "ring_buffer_open_file");
mock_provider mp; mock_provider mp;
@ -221,7 +221,7 @@ TEST(ring_buffer_open_file,
TEST(ring_buffer_open_file, can_reverse_before_first_chunk) { TEST(ring_buffer_open_file, can_reverse_before_first_chunk) {
const auto source_path = const auto source_path =
generate_test_file_name(get_test_dir(), "ring_buffer_open_file"); generate_test_file_name("./test_config", "ring_buffer_open_file");
mock_provider mp; mock_provider mp;
@ -253,7 +253,7 @@ TEST(ring_buffer_open_file, can_reverse_before_first_chunk) {
TEST(ring_buffer_open_file, can_reverse_and_rollover_before_first_chunk) { TEST(ring_buffer_open_file, can_reverse_and_rollover_before_first_chunk) {
const auto source_path = const auto source_path =
generate_test_file_name(get_test_dir(), "ring_buffer_open_file"); generate_test_file_name("./test_config", "ring_buffer_open_file");
mock_provider mp; mock_provider mp;
@ -289,7 +289,7 @@ TEST(ring_buffer_open_file, can_reverse_and_rollover_before_first_chunk) {
TEST(ring_buffer_open_file, can_reverse_full_ring) { TEST(ring_buffer_open_file, can_reverse_full_ring) {
const auto source_path = const auto source_path =
generate_test_file_name(get_test_dir(), "ring_buffer_open_file"); generate_test_file_name("./test_config", "ring_buffer_open_file");
mock_provider mp; mock_provider mp;
@ -321,11 +321,11 @@ TEST(ring_buffer_open_file, can_reverse_full_ring) {
TEST(ring_buffer_open_file, read_full_file) { TEST(ring_buffer_open_file, read_full_file) {
const auto download_source_path = const auto download_source_path =
generate_test_file_name(get_test_dir(), "ring_buffer_open_file"); generate_test_file_name("./test_config", "ring_buffer_open_file");
auto nf = create_random_file(download_source_path, test_chunk_size * 32u); auto nf = create_random_file(download_source_path, test_chunk_size * 32u);
const auto dest_path = const auto dest_path =
generate_test_file_name(get_test_dir(), "ring_buffer_open_file"); generate_test_file_name("./test_config", "ring_buffer_open_file");
mock_provider mp; mock_provider mp;
@ -336,7 +336,7 @@ TEST(ring_buffer_open_file, read_full_file) {
fsi.api_path = "/test.txt"; fsi.api_path = "/test.txt";
fsi.size = test_chunk_size * 32u; fsi.size = test_chunk_size * 32u;
fsi.source_path = fsi.source_path =
generate_test_file_name(get_test_dir(), "ring_buffer_open_file"); generate_test_file_name("./test_config", "ring_buffer_open_file");
EXPECT_CALL(mp, read_file_bytes) EXPECT_CALL(mp, read_file_bytes)
.WillRepeatedly([&nf](const std::string & /* api_path */, .WillRepeatedly([&nf](const std::string & /* api_path */,
@ -384,11 +384,11 @@ TEST(ring_buffer_open_file, read_full_file) {
TEST(ring_buffer_open_file, read_full_file_in_reverse) { TEST(ring_buffer_open_file, read_full_file_in_reverse) {
const auto download_source_path = const auto download_source_path =
generate_test_file_name(get_test_dir(), "ring_buffer_open_file"); generate_test_file_name("./test_config", "ring_buffer_open_file");
auto nf = create_random_file(download_source_path, test_chunk_size * 32u); auto nf = create_random_file(download_source_path, test_chunk_size * 32u);
const auto dest_path = const auto dest_path =
generate_test_file_name(get_test_dir(), "ring_buffer_open_file"); generate_test_file_name("./test_config", "ring_buffer_open_file");
mock_provider mp; mock_provider mp;
@ -399,7 +399,7 @@ TEST(ring_buffer_open_file, read_full_file_in_reverse) {
fsi.api_path = "/test.txt"; fsi.api_path = "/test.txt";
fsi.size = test_chunk_size * 32u; fsi.size = test_chunk_size * 32u;
fsi.source_path = fsi.source_path =
generate_test_file_name(get_test_dir(), "ring_buffer_open_file"); generate_test_file_name("./test_config", "ring_buffer_open_file");
EXPECT_CALL(mp, read_file_bytes) EXPECT_CALL(mp, read_file_bytes)
.WillRepeatedly([&nf](const std::string & /* api_path */, .WillRepeatedly([&nf](const std::string & /* api_path */,
@ -447,11 +447,11 @@ TEST(ring_buffer_open_file, read_full_file_in_reverse) {
TEST(ring_buffer_open_file, read_full_file_in_partial_chunks) { TEST(ring_buffer_open_file, read_full_file_in_partial_chunks) {
const auto download_source_path = const auto download_source_path =
generate_test_file_name(get_test_dir(), "ring_buffer_open_file"); generate_test_file_name("./test_config", "ring_buffer_open_file");
auto nf = create_random_file(download_source_path, test_chunk_size * 32u); auto nf = create_random_file(download_source_path, test_chunk_size * 32u);
const auto dest_path = const auto dest_path =
generate_test_file_name(get_test_dir(), "ring_buffer_open_file"); generate_test_file_name("./test_config", "ring_buffer_open_file");
mock_provider mp; mock_provider mp;
@ -462,7 +462,7 @@ TEST(ring_buffer_open_file, read_full_file_in_partial_chunks) {
fsi.api_path = "/test.txt"; fsi.api_path = "/test.txt";
fsi.size = test_chunk_size * 32u; fsi.size = test_chunk_size * 32u;
fsi.source_path = fsi.source_path =
generate_test_file_name(get_test_dir(), "ring_buffer_open_file"); generate_test_file_name("./test_config", "ring_buffer_open_file");
EXPECT_CALL(mp, read_file_bytes) EXPECT_CALL(mp, read_file_bytes)
.WillRepeatedly([&nf](const std::string & /* api_path */, .WillRepeatedly([&nf](const std::string & /* api_path */,
@ -508,11 +508,11 @@ TEST(ring_buffer_open_file, read_full_file_in_partial_chunks) {
TEST(ring_buffer_open_file, read_full_file_in_partial_chunks_in_reverse) { TEST(ring_buffer_open_file, read_full_file_in_partial_chunks_in_reverse) {
const auto download_source_path = const auto download_source_path =
generate_test_file_name(get_test_dir(), "ring_buffer_open_file"); generate_test_file_name("./test_config", "ring_buffer_open_file");
auto nf = create_random_file(download_source_path, test_chunk_size * 32u); auto nf = create_random_file(download_source_path, test_chunk_size * 32u);
const auto dest_path = const auto dest_path =
generate_test_file_name(get_test_dir(), "ring_buffer_open_file"); generate_test_file_name("./test_config", "ring_buffer_open_file");
mock_provider mp; mock_provider mp;
@ -523,7 +523,7 @@ TEST(ring_buffer_open_file, read_full_file_in_partial_chunks_in_reverse) {
fsi.api_path = "/test.txt"; fsi.api_path = "/test.txt";
fsi.size = test_chunk_size * 32u; fsi.size = test_chunk_size * 32u;
fsi.source_path = fsi.source_path =
generate_test_file_name(get_test_dir(), "ring_buffer_open_file"); generate_test_file_name("./test_config", "ring_buffer_open_file");
EXPECT_CALL(mp, read_file_bytes) EXPECT_CALL(mp, read_file_bytes)
.WillRepeatedly([&nf](const std::string & /* api_path */, .WillRepeatedly([&nf](const std::string & /* api_path */,

View File

@ -42,7 +42,7 @@
namespace repertory { namespace repertory {
static std::string file_manager_dir = static std::string file_manager_dir =
utils::path::combine(get_test_dir(), {"file_manager_test"}); utils::path::combine("./test_config", {"file_manager_test"});
auto file_manager::open(std::shared_ptr<i_closeable_open_file> of, auto file_manager::open(std::shared_ptr<i_closeable_open_file> of,
const open_file_data &ofd, std::uint64_t &handle, const open_file_data &ofd, std::uint64_t &handle,
@ -426,7 +426,7 @@ TEST(file_manager, download_is_stored_after_write_if_partially_downloaded) {
utils::encryption::encrypting_reader::get_data_chunk_size() * 4u, utils::encryption::encrypting_reader::get_data_chunk_size() * 4u,
source_path, 10, now + 4u); source_path, 10, now + 4u);
auto nf = create_random_file( auto nf = create_random_file(
generate_test_file_name(get_test_dir(), "file_manage_test"), generate_test_file_name("./test_config", "file_manage_test"),
utils::string::to_uint64(meta[META_SIZE])); utils::string::to_uint64(meta[META_SIZE]));
EXPECT_CALL(mp, get_filesystem_item) EXPECT_CALL(mp, get_filesystem_item)
@ -589,7 +589,7 @@ TEST(file_manager, upload_occurs_after_write_if_fully_downloaded) {
utils::encryption::encrypting_reader::get_data_chunk_size() * 4u, utils::encryption::encrypting_reader::get_data_chunk_size() * 4u,
source_path, 10, now + 4u); source_path, 10, now + 4u);
auto nf = create_random_file( auto nf = create_random_file(
generate_test_file_name(get_test_dir(), "file_manage_test"), generate_test_file_name("./test_config", "file_manage_test"),
utils::string::to_uint64(meta[META_SIZE])); utils::string::to_uint64(meta[META_SIZE]));
EXPECT_CALL(mp, get_filesystem_item) EXPECT_CALL(mp, get_filesystem_item)

View File

@ -36,7 +36,7 @@ TEST(upload, can_upload_a_valid_file) {
event_system::instance().start(); event_system::instance().start();
const auto source_path = const auto source_path =
generate_test_file_name(get_test_dir(), "upload_test"); generate_test_file_name("./test_config", "upload_test");
mock_provider mp; mock_provider mp;
@ -80,7 +80,7 @@ TEST(upload, can_cancel_upload) {
event_system::instance().start(); event_system::instance().start();
const auto source_path = const auto source_path =
generate_test_file_name(get_test_dir(), "upload_test"); generate_test_file_name("./test_config", "upload_test");
mock_provider mp; mock_provider mp;
@ -146,7 +146,7 @@ TEST(upload, can_stop_upload) {
event_system::instance().start(); event_system::instance().start();
const auto source_path = const auto source_path =
generate_test_file_name(get_test_dir(), "upload_test"); generate_test_file_name("./test_config", "upload_test");
mock_provider mp; mock_provider mp;

View File

@ -515,7 +515,7 @@ TEST(fuse_drive, all_tests) {
std::filesystem::current_path(current_directory); std::filesystem::current_path(current_directory);
const auto test_directory = utils::path::combine( const auto test_directory = utils::path::combine(
get_test_dir(), {"fuse_drive" + std::to_string(idx)}); "./test_config", {"fuse_drive" + std::to_string(idx)});
EXPECT_TRUE(utils::file::delete_directory_recursively(test_directory)); EXPECT_TRUE(utils::file::delete_directory_recursively(test_directory));
const auto mount_location = const auto mount_location =

View File

@ -107,8 +107,8 @@ const auto create_directory = [](repertory::i_provider &provider,
const auto create_file = [](repertory::i_provider &provider, const auto create_file = [](repertory::i_provider &provider,
const std::string &api_path) { const std::string &api_path) {
auto source_path = repertory::generate_test_file_name( auto source_path =
repertory::get_test_dir(), "providers_test"); repertory::generate_test_file_name("./test_config", "providers_test");
auto date = repertory::utils::time::get_file_time_now(); auto date = repertory::utils::time::get_file_time_now();
auto meta = repertory::create_meta_attributes( auto meta = repertory::create_meta_attributes(
@ -630,7 +630,7 @@ static void run_tests(const app_config &cfg, i_provider &provider) {
TEST(providers, encrypt_provider) { TEST(providers, encrypt_provider) {
const auto config_path = const auto config_path =
utils::path::combine(get_test_dir(), {"encrypt_provider"}); utils::path::combine("./test_config", {"encrypt_provider"});
ASSERT_TRUE(utils::file::delete_directory_recursively(config_path)); ASSERT_TRUE(utils::file::delete_directory_recursively(config_path));
console_consumer consumer{}; console_consumer consumer{};
@ -673,7 +673,7 @@ TEST(providers, encrypt_provider) {
TEST(providers, s3_provider) { TEST(providers, s3_provider) {
const auto config_path = const auto config_path =
utils::path::combine(get_test_dir(), {"s3_provider"}); utils::path::combine("./test_config", {"s3_provider"});
ASSERT_TRUE(utils::file::delete_directory_recursively(config_path)); ASSERT_TRUE(utils::file::delete_directory_recursively(config_path));
console_consumer consumer{}; console_consumer consumer{};
@ -711,7 +711,7 @@ TEST(providers, s3_provider) {
TEST(providers, sia_provider) { TEST(providers, sia_provider) {
const auto config_path = const auto config_path =
utils::path::combine(get_test_dir(), {"sia_provider"}); utils::path::combine("./test_config", {"sia_provider"});
ASSERT_TRUE(utils::file::delete_directory_recursively(config_path)); ASSERT_TRUE(utils::file::delete_directory_recursively(config_path));
console_consumer consumer{}; console_consumer consumer{};

View File

@ -46,7 +46,7 @@ using namespace repertory::remote_fuse;
namespace fuse_test { namespace fuse_test {
static std::string mount_location_; static std::string mount_location_;
static std::string fuse_remote_dir = static std::string fuse_remote_dir =
utils::path::combine(get_test_dir(), {"fuse_remote_test"}); utils::path::combine("./test_config", {"fuse_remote_test"});
static void access_test(repertory::remote_fuse::remote_client &client) { static void access_test(repertory::remote_fuse::remote_client &client) {
const auto test_file = utils::path::combine(fuse_remote_dir, {"access.txt"}); const auto test_file = utils::path::combine(fuse_remote_dir, {"access.txt"});
@ -933,7 +933,7 @@ TEST(remote_fuse, all_tests) {
event_system::instance().start(); event_system::instance().start();
#if defined(_WIN32) #if defined(_WIN32)
mount_location_ = std::string(get_test_dir()).substr(0, 2); mount_location_ = std::string("./test_config").substr(0, 2);
mock_winfsp_drive drive(mount_location_); mock_winfsp_drive drive(mount_location_);
remote_server server(config, drive, mount_location_); remote_server server(config, drive, mount_location_);
#else #else

View File

@ -40,7 +40,7 @@ using namespace repertory::remote_winfsp;
namespace winfsp_test { namespace winfsp_test {
static std::string mount_location_; static std::string mount_location_;
static std::string win_remote_dir = static std::string win_remote_dir =
utils::path::combine(get_test_dir(), {"win_remote_test"}); utils::path::combine("./test_config", {"win_remote_test"});
static void can_delete_test(remote_client &client) { static void can_delete_test(remote_client &client) {
const auto test_file = const auto test_file =
@ -502,7 +502,7 @@ TEST(remote_winfsp, all_tests) {
event_system::instance().start(); event_system::instance().start();
#if defined(_WIN32) #if defined(_WIN32)
mount_location_ = std::string(get_test_dir()).substr(0, 2); mount_location_ = std::string("./test_config").substr(0, 2);
mock_winfsp_drive drive(mount_location_); mock_winfsp_drive drive(mount_location_);
remote_server server(config, drive, mount_location_); remote_server server(config, drive, mount_location_);
#else #else