test fixes
All checks were successful
BlockStorage/repertory_osx_builds/pipeline/head This commit looks good
BlockStorage/repertory_linux_builds/pipeline/head This commit looks good

This commit is contained in:
2023-11-30 12:54:00 -06:00
parent e2e82edefb
commit 33e8e0890b
2 changed files with 28 additions and 22 deletions

View File

@@ -1315,6 +1315,9 @@ TEST(file_manager,
EXPECT_CALL(mp, set_item_meta("/test_open.txt", META_SOURCE, _))
.WillOnce(Return(api_error::success));
EXPECT_CALL(*non_writeable, has_handle(1)).WillOnce([]() -> bool {
return true;
});
EXPECT_TRUE(fm.get_open_file(handle, true, f));
EXPECT_NE(non_writeable.get(), f.get());
EXPECT_EQ(std::size_t(1U), fm.get_open_file_count());
@@ -1495,6 +1498,10 @@ TEST(file_manager, open_file_creates_source_path_if_empty) {
#else
EXPECT_EQ(api_error::success, fm.open(of, O_RDWR, handle, f));
#endif
EXPECT_CALL(*of, has_handle(1)).Times(2).WillRepeatedly([]() -> bool {
return true;
});
EXPECT_TRUE(fm.get_open_file(1U, true, f));
EXPECT_EQ(std::size_t(1U), fm.get_open_file_count());
EXPECT_TRUE(f);
@@ -1546,6 +1553,8 @@ TEST(file_manager, open_file_first_file_handle_is_not_zero) {
#else
EXPECT_EQ(api_error::success, fm.open(of, O_RDWR, handle, f));
#endif
EXPECT_CALL(*of, has_handle(1)).WillOnce([]() -> bool { return true; });
EXPECT_TRUE(fm.get_open_file(1U, true, f));
EXPECT_GT(handle, std::uint64_t(0U));
}