1 #include <fcntl.h> 2 #include <gtest/gtest.h> 3 #include <sys/stat.h> 4 using namespace testing::ext; 5 6 class StatUmaskTest : public testing::Test { SetUp()7 void SetUp() override {} TearDown()8 void TearDown() override {} 9 }; 10 11 /** 12 * @tc.name: stat_001 13 * @tc.desc: Verifiy that the umask() function can successfully set and retrieve the file mode creation mask for 14 * the current process 15 * @tc.type: FUNC 16 **/ 17 HWTEST_F(StatUmaskTest, umask_001, TestSize.Level1) 18 { 19 mode_t umaskValue = 0022; 20 umask(umaskValue); 21 mode_t currentUmask = umask(0); 22 EXPECT_EQ(currentUmask, umaskValue); 23 } 24