From c86c6e2ec61b545f2ed79a02ead45cfb77a27225 Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Fri, 4 Apr 2025 21:31:11 -0500 Subject: [PATCH] fix test --- repertory/repertory_test/src/winfsp_drive_rename_test.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/repertory/repertory_test/src/winfsp_drive_rename_test.cpp b/repertory/repertory_test/src/winfsp_drive_rename_test.cpp index 809eadf8..d0a6f45d 100644 --- a/repertory/repertory_test/src/winfsp_drive_rename_test.cpp +++ b/repertory/repertory_test/src/winfsp_drive_rename_test.cpp @@ -73,6 +73,9 @@ TYPED_TEST(winfsp_test, rename_fails_if_dest_exists_and_replace_is_false) { auto file_path2{ utils::path::combine(dir_path, {"test_file2_4"}), }; + auto file_path3{ + utils::path::combine(dir_path, {"test_file_5"}), + }; ASSERT_TRUE(::CreateDirectoryA(dir_path.c_str(), nullptr)); @@ -84,7 +87,7 @@ TYPED_TEST(winfsp_test, rename_fails_if_dest_exists_and_replace_is_false) { EXPECT_TRUE(::MoveFileExA(file_path.c_str(), file_path2.c_str(), 0)); - handle = ::CreateFileA(file_path.c_str(), GENERIC_READ | GENERIC_WRITE, + handle = ::CreateFileA(file_path3.c_str(), GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, nullptr, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, nullptr); ASSERT_NE(INVALID_HANDLE_VALUE, handle); @@ -93,7 +96,7 @@ TYPED_TEST(winfsp_test, rename_fails_if_dest_exists_and_replace_is_false) { EXPECT_FALSE(::MoveFileExA(file_path.c_str(), file_path2.c_str(), 0)); EXPECT_EQ(ERROR_ALREADY_EXISTS, ::GetLastError()); - EXPECT_TRUE(::DeleteFileA(file_path.c_str())); + EXPECT_TRUE(::DeleteFileA(file_path3.c_str())); EXPECT_TRUE(::DeleteFileA(file_path2.c_str())); EXPECT_TRUE(::RemoveDirectoryA(dir_path.c_str())); }