diff --git a/kernel_lite/process_posix/src/UidGidTest.cpp b/kernel_lite/process_posix/src/UidGidTest.cpp index 6c4e7c4c8192eab99b9de29248c8e72c655bc08b..a8fe8d0fdc5a53323beec0906f07178165d4393e 100755 --- a/kernel_lite/process_posix/src/UidGidTest.cpp +++ b/kernel_lite/process_posix/src/UidGidTest.cpp @@ -691,6 +691,8 @@ HWTEST_F(UidGidTest, testSetgroups1, Function | MediumTest | Level1) n = getgroups(2, gidListOut); EXPECT_EQ(n, 1); EXPECT_EQ(gidListOut[0], SHELL_GID); + gidListOut[0] = 2; + int ret = setgroups(2, gidListOut); free(gidListIn); free(gidListOut); } @@ -706,8 +708,8 @@ HWTEST_F(UidGidTest, testSetgroups2, Function | MediumTest | Level1) gid_t gidListOut[4] = {0}; LOG("Init: make sure groups not changed by other test."); - int n = getgroups(1, gidListOut); - EXPECT_EQ(n, 1); + int n = getgroups(2, gidListOut); + EXPECT_EQ(n, 2); EXPECT_EQ(gidListOut[0], SHELL_GID); LOG("add 2 groups");