This commit is contained in:
2024-10-09 14:03:06 -05:00
parent 27b37eb570
commit b35e100bb2
2 changed files with 12 additions and 6 deletions

View File

@@ -1324,14 +1324,18 @@ TEST(file_manager,
#if defined(_WIN32)
EXPECT_EQ(api_error::success, fm.open(non_writeable, {}, handle, f));
EXPECT_CALL(*non_writeable, get_open_data())
.WillOnce([&handle]() -> std::map<std::uint64_t, open_file_data> {
return {{handle, {}}};
.WillOnce([&handle]() -> std::map<std::uint64_t, open_file_data>& {
static std::map<std::uint64_t, open_file_data> map;
map[handle]={};
return map;
});
#else
EXPECT_EQ(api_error::success, fm.open(non_writeable, O_RDWR, handle, f));
EXPECT_CALL(*non_writeable, get_open_data())
.WillOnce([&handle]() -> std::map<std::uint64_t, open_file_data> {
return {{handle, O_RDWR}};
.WillOnce([&handle]() -> std::map<std::uint64_t, open_file_data>& {
static std::map<std::uint64_t, open_file_data> map;
map[handle]=O_RDWR;
return map;
});
#endif