Skip to content

Commit 014c7fa

Browse files
committed
Delete unnecessary code in tests
delete_directory_recursive, called by test fixture cleanup code, will delete directories even if permissions disallow traversal. This means manually chmod-ing these directories in the test is unnecessary. Delete the redundant chmod calls. This commit should not reduce test coverage.
1 parent d64703f commit 014c7fa

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

test/test-file-canonical.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -846,10 +846,6 @@ TEST_F(test_file_canonical, unsearchable_parent_directory) {
846846
EXPECT_THAT(canonical.error().canonicalizing_path,
847847
::testing::EndsWith("dir/file"));
848848
EXPECT_EQ(canonical.error().io_error.error, EACCES);
849-
850-
// Allow test cleanup to delete the directory.
851-
EXPECT_EQ(::chmod((temp_dir + "/dir").c_str(), 0700), 0)
852-
<< std::strerror(errno);
853849
}
854850

855851
TEST_F(test_file_canonical, unsearchable_grandparent_directory) {
@@ -872,10 +868,6 @@ TEST_F(test_file_canonical, unsearchable_grandparent_directory) {
872868
EXPECT_THAT(canonical.error().canonicalizing_path,
873869
::testing::EndsWith("dir/subdir"));
874870
EXPECT_EQ(canonical.error().io_error.error, EACCES);
875-
876-
// Allow test cleanup to delete the directory.
877-
EXPECT_EQ(::chmod((temp_dir + "/dir").c_str(), 0700), 0)
878-
<< std::strerror(errno);
879871
}
880872
#endif
881873

0 commit comments

Comments
 (0)