1 #include <errno.h> 2 #include <grp.h> 3 #include <gtest/gtest.h> 4 using namespace testing::ext; 5 6 class PasswdEndgrentTest : public testing::Test { SetUp()7 void SetUp() override {} TearDown()8 void TearDown() override {} 9 }; 10 11 /** 12 * @tc.name: endgrent_001 13 * @tc.desc: The endgrent function is called to close the group database and release any associated resources. 14 * @tc.type: FUNC 15 **/ 16 HWTEST_F(PasswdEndgrentTest, endgrent_001, TestSize.Level1) 17 { 18 errno = 0; 19 setgrent(); 20 endgrent(); 21 EXPECT_EQ(0, errno); 22 }