fuse unit tests and fixes

This commit is contained in:
Scott E. Graves 2024-11-09 16:21:13 -06:00
parent 6f6f8d4d52
commit 43ce2d13ec

View File

@ -30,8 +30,7 @@ TYPED_TEST(fuse_test, can_create_and_remove_directory) {
auto dir_name = std::string{"dir"}; auto dir_name = std::string{"dir"};
auto dir_path = utils::path::combine(this->mount_location, {dir_name}); auto dir_path = utils::path::combine(this->mount_location, {dir_name});
EXPECT_EQ(0, mkdir(dir_path.c_str(), S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | EXPECT_EQ(0, mkdir(dir_path.c_str(), S_IRUSR | S_IXUSR));
S_IWGRP | S_IXGRP));
EXPECT_TRUE(utils::file::directory(dir_path).exists()); EXPECT_TRUE(utils::file::directory(dir_path).exists());
EXPECT_FALSE(utils::file::file(dir_path).exists()); EXPECT_FALSE(utils::file::file(dir_path).exists());
@ -42,11 +41,11 @@ TYPED_TEST(fuse_test, can_create_and_remove_directory) {
EXPECT_EQ(getgid(), unix_st.st_gid); EXPECT_EQ(getgid(), unix_st.st_gid);
EXPECT_EQ(getuid(), unix_st.st_uid); EXPECT_EQ(getuid(), unix_st.st_uid);
EXPECT_EQ(static_cast<std::uint32_t>(S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | EXPECT_EQ(static_cast<std::uint32_t>(S_IRUSR | S_IXUSR),
S_IWGRP | S_IXGRP),
ACCESSPERMS & unix_st.st_mode); ACCESSPERMS & unix_st.st_mode);
EXPECT_TRUE(utils::file::directory(dir_path).remove()); EXPECT_TRUE(utils::file::directory(dir_path).remove());
EXPECT_FALSE(utils::file::directory(dir_path).exists());
} }
} // namespace repertory } // namespace repertory