fix test
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good

This commit is contained in:
Scott E. Graves 2025-04-04 21:21:17 -05:00
parent f8803dfbf0
commit c397497eb7

View File

@ -84,9 +84,16 @@ 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)); EXPECT_TRUE(::MoveFileExA(file_path.c_str(), file_path2.c_str(), 0));
handle = ::CreateFileA(file_path.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);
::CloseHandle(handle);
EXPECT_FALSE(::MoveFileExA(file_path.c_str(), file_path2.c_str(), 0)); EXPECT_FALSE(::MoveFileExA(file_path.c_str(), file_path2.c_str(), 0));
EXPECT_EQ(ERROR_ALREADY_EXISTS, ::GetLastError()); EXPECT_EQ(ERROR_ALREADY_EXISTS, ::GetLastError());
EXPECT_TRUE(::DeleteFileA(file_path.c_str()));
EXPECT_TRUE(::DeleteFileA(file_path2.c_str())); EXPECT_TRUE(::DeleteFileA(file_path2.c_str()));
EXPECT_TRUE(::RemoveDirectoryA(dir_path.c_str())); EXPECT_TRUE(::RemoveDirectoryA(dir_path.c_str()));
} }