diff --git a/repertory/repertory_test/src/fuse_drive_create_and_open_test.cpp b/repertory/repertory_test/src/fuse_drive_create_and_open_test.cpp index 983d8532..f7eca296 100644 --- a/repertory/repertory_test/src/fuse_drive_create_and_open_test.cpp +++ b/repertory/repertory_test/src/fuse_drive_create_and_open_test.cpp @@ -71,6 +71,50 @@ TYPED_TEST(fuse_test, create_can_create_file) { this->unlink_file_and_test(file_path); } +TYPED_TEST(fuse_test, create_can_create_file_ro) { + std::string file_name{"create_test"}; + auto file_path = this->create_file_path(file_name); + + auto handle = open(file_path.c_str(), O_CREAT | O_RDONLY, ACCESSPERMS); + EXPECT_LE(1, handle); + close(handle); + + this->unlink_file_and_test(file_path); +} + +TYPED_TEST(fuse_test, create_can_create_file_rw) { + std::string file_name{"create_test"}; + auto file_path = this->create_file_path(file_name); + + auto handle = open(file_path.c_str(), O_CREAT | O_RDWR, ACCESSPERMS); + EXPECT_LE(1, handle); + close(handle); + + this->unlink_file_and_test(file_path); +} + +TYPED_TEST(fuse_test, create_can_create_file_wo) { + std::string file_name{"create_test"}; + auto file_path = this->create_file_path(file_name); + + auto handle = open(file_path.c_str(), O_CREAT | O_WRONLY, ACCESSPERMS); + EXPECT_LE(1, handle); + close(handle); + + this->unlink_file_and_test(file_path); +} + +TYPED_TEST(fuse_test, create_can_create_file_for_append) { + std::string file_name{"create_test"}; + auto file_path = this->create_file_path(file_name); + + auto handle = open(file_path.c_str(), O_CREAT | O_APPEND, ACCESSPERMS); + EXPECT_LE(1, handle); + close(handle); + + this->unlink_file_and_test(file_path); +} + TYPED_TEST(fuse_test, create_can_create_with_truncate_file) { std::string file_name{"create_test"}; auto file_path = this->create_file_path(file_name); @@ -169,6 +213,17 @@ TYPED_TEST(fuse_test, create_can_open_existing_file_wo) { this->unlink_file_and_test(file_path); } + +TYPED_TEST(fuse_test, create_can_open_existing_file_for_append) { + std::string file_name{"create_test"}; + auto file_path = this->create_file_and_test(file_name); + + auto handle = open(file_path.c_str(), O_APPEND, ACCESSPERMS); + EXPECT_LE(1, handle); + close(handle); + + this->unlink_file_and_test(file_path); +} } // namespace repertory #endif // !defined(_WIN32)