From 0089866142fdca8de7b67227d3e0eed71e756c68 Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Thu, 26 Sep 2024 09:00:32 -0500 Subject: [PATCH] removed test --- .../repertory_test/src/file_manager_test.cpp | 54 ------------------- 1 file changed, 54 deletions(-) diff --git a/repertory/repertory_test/src/file_manager_test.cpp b/repertory/repertory_test/src/file_manager_test.cpp index 63cfd69d..f856ed2d 100644 --- a/repertory/repertory_test/src/file_manager_test.cpp +++ b/repertory/repertory_test/src/file_manager_test.cpp @@ -1661,60 +1661,6 @@ TEST(file_manager, can_queue_and_remove_upload) { EXPECT_TRUE(utils::file::directory(file_manager_dir).remove_recursively()); } -TEST(file_manager, remove_file_fails_if_open_file_is_modified) { - EXPECT_TRUE(utils::file::directory(file_manager_dir).remove_recursively()); - - { - app_config cfg(provider_type::sia, file_manager_dir); - cfg.set_enable_chunk_downloader_timeout(false); - mock_provider mp; - - EXPECT_CALL(mp, is_direct_only()).WillRepeatedly(Return(false)); - - file_manager fm(cfg, mp); - - auto of = std::make_shared(); - EXPECT_CALL(*of, add).WillOnce(Return()); - EXPECT_CALL(*of, get_api_path).WillRepeatedly(Return("/test_remove.txt")); - EXPECT_CALL(*of, get_source_path).WillRepeatedly(Return("")); - EXPECT_CALL(*of, is_modified).WillOnce(Return(true)); - EXPECT_CALL(*of, is_directory).WillOnce(Return(false)); - - EXPECT_CALL(mp, get_filesystem_item) - .WillOnce([](const std::string &api_path, bool directory, - filesystem_item &fsi) -> api_error { - EXPECT_STREQ("/test_remove.txt", api_path.c_str()); - EXPECT_FALSE(directory); - fsi.api_path = api_path; - fsi.api_parent = utils::path::get_parent_api_path(api_path); - fsi.directory = directory; - fsi.size = 0U; - return api_error::success; - }); - - EXPECT_CALL(mp, set_item_meta(_, _, _)) - .WillOnce([](const std::string &api_path, const std::string &key, - const std::string &value) -> api_error { - EXPECT_STREQ("/test_remove.txt", api_path.c_str()); - EXPECT_STREQ(META_SOURCE.c_str(), key.c_str()); - EXPECT_FALSE(value.empty()); - return api_error::success; - }); - - std::uint64_t handle{}; - std::shared_ptr f{}; -#if defined(_WIN32) - EXPECT_EQ(api_error::success, fm.open(of, {}, handle, f)); -#else - EXPECT_EQ(api_error::success, fm.open(of, O_RDWR, handle, f)); -#endif - - EXPECT_EQ(api_error::file_in_use, fm.remove_file("/test_remove.txt")); - } - - EXPECT_TRUE(utils::file::directory(file_manager_dir).remove_recursively()); -} - TEST(file_manager, file_is_closed_after_download_timeout) { { console_consumer c;