From 05b61410ca5d2e8efe766c9373518b23665c0f3b Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Thu, 26 Dec 2024 11:17:39 -0600 Subject: [PATCH] unit tests and fixes --- .../src/file_manager/file_manager.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/repertory/librepertory/src/file_manager/file_manager.cpp b/repertory/librepertory/src/file_manager/file_manager.cpp index 401146a5..56bb87ee 100644 --- a/repertory/librepertory/src/file_manager/file_manager.cpp +++ b/repertory/librepertory/src/file_manager/file_manager.cpp @@ -189,13 +189,13 @@ auto file_manager::evict_file(const std::string &api_path) -> bool { open_file_lookup_.erase(api_path); auto allocated = closeable_file ? closeable_file->get_allocated() : true; - - auto removed = remove_source_and_shrink_cache(api_path, source_path, fsi.size, - allocated); open_lock.unlock(); closeable_file.reset(); + auto removed = remove_source_and_shrink_cache(api_path, source_path, fsi.size, + allocated); + if (removed) { event_system::instance().raise(api_path, source_path); @@ -387,10 +387,11 @@ auto file_manager::open(const std::string &api_path, bool directory, return open(api_path, directory, ofd, handle, file, nullptr); } -auto file_manager::open( - const std::string &api_path, bool directory, const open_file_data &ofd, - std::uint64_t &handle, std::shared_ptr &file, - std::shared_ptr closeable_file) -> api_error { +auto file_manager::open(const std::string &api_path, bool directory, + const open_file_data &ofd, std::uint64_t &handle, + std::shared_ptr &file, + std::shared_ptr closeable_file) + -> api_error { REPERTORY_USES_FUNCTION_NAME(); const auto create_and_add_handle = @@ -754,8 +755,8 @@ auto file_manager::rename_directory(const std::string &from_api_path, } auto file_manager::rename_file(const std::string &from_api_path, - const std::string &to_api_path, - bool overwrite) -> api_error { + const std::string &to_api_path, bool overwrite) + -> api_error { if (not provider_.is_rename_supported()) { return api_error::not_implemented; }