Skip to content

Commit

Permalink
Mock some set_permissions that failed before
Browse files Browse the repository at this point in the history
  • Loading branch information
Sploder12 committed Dec 18, 2024
1 parent a5015cd commit 21e362f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/test_sftpserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1490,6 +1490,9 @@ TEST_F(SftpServer, open_chown_failure_fails)

TEST_F(SftpServer, open_no_handle_allocated_fails)
{
const auto [platform, mock_platform_guard] = mpt::MockPlatform::inject<NiceMock>();
EXPECT_CALL(*platform, set_permissions(_, _)).WillRepeatedly(Return(true));

mpt::TempDir temp_dir;
auto file_name = temp_dir.path() + "/test-file";

Expand Down Expand Up @@ -1760,6 +1763,9 @@ TEST_F(SftpServer, handles_fstat)

TEST_F(SftpServer, handles_fsetstat)
{
const auto [platform, mock_platform_guard] = mpt::MockPlatform::inject<NiceMock>();
EXPECT_CALL(*platform, set_permissions(_, _)).WillRepeatedly(Return(true));

mpt::TempDir temp_dir;
auto file_name = temp_dir.path() + "/test-file";

Expand Down Expand Up @@ -1804,6 +1810,9 @@ TEST_F(SftpServer, handles_fsetstat)

TEST_F(SftpServer, handles_setstat)
{
const auto [platform, mock_platform_guard] = mpt::MockPlatform::inject<NiceMock>();
EXPECT_CALL(*platform, set_permissions(_, _)).WillRepeatedly(Return(true));

mpt::TempDir temp_dir;
auto file_name = temp_dir.path() + "/test-file";
mpt::make_file_with_content(file_name);
Expand Down

0 comments on commit 21e362f

Please sign in to comment.