Lines Matching refs:grp

174 static void check_group(const group* grp, const char* group_name, gid_t gid) {  in check_group()  argument
175 ASSERT_TRUE(grp != NULL); in check_group()
176 ASSERT_STREQ(group_name, grp->gr_name); in check_group()
177 ASSERT_EQ(gid, grp->gr_gid); in check_group()
178 ASSERT_TRUE(grp->gr_mem != NULL); in check_group()
179 ASSERT_STREQ(group_name, grp->gr_mem[0]); in check_group()
180 ASSERT_TRUE(grp->gr_mem[1] == NULL); in check_group()
187 group* grp = getgrgid(gid); in check_getgrgid() local
190 check_group(grp, group_name, gid); in check_getgrgid()
195 group* grp = getgrnam(group_name); in check_getgrnam() local
198 check_group(grp, group_name, gid); in check_getgrnam()
204 group* grp; in check_getgrgid_r() local
207 int result = getgrgid_r(gid, &grp_storage, buf, sizeof(buf), &grp); in check_getgrgid_r()
211 check_group(grp, group_name, gid); in check_getgrgid_r()
217 group* grp; in check_getgrnam_r() local
220 int result = getgrnam_r(group_name, &grp_storage, buf, sizeof(buf), &grp); in check_getgrnam_r()
224 check_group(grp, group_name, gid); in check_getgrnam_r()
315 group* grp[3]; in TEST() local
316 int result = getgrnam_r("root", &grp_storage[0], buf[0], sizeof(buf[0]), &grp[0]); in TEST()
318 check_group(grp[0], "root", 0); in TEST()
319 grp[1] = getgrnam("system"); in TEST()
320 check_group(grp[1], "system", 1000); in TEST()
321 result = getgrnam_r("radio", &grp_storage[1], buf[1], sizeof(buf[1]), &grp[2]); in TEST()
323 check_group(grp[2], "radio", 1001); in TEST()
324 check_group(grp[0], "root", 0); in TEST()
325 check_group(grp[1], "system", 1000); in TEST()
335 group* grp[3]; in TEST() local
336 int result = getgrgid_r(0, &grp_storage[0], buf[0], sizeof(buf[0]), &grp[0]); in TEST()
338 check_group(grp[0], "root", 0); in TEST()
339 grp[1] = getgrgid(1000); in TEST()
340 check_group(grp[1], "system", 1000); in TEST()
341 result = getgrgid_r(1001, &grp_storage[1], buf[1], sizeof(buf[1]), &grp[2]); in TEST()
343 check_group(grp[2], "radio", 1001); in TEST()
344 check_group(grp[0], "root", 0); in TEST()
345 check_group(grp[1], "system", 1000); in TEST()
356 group* grp; in TEST() local
357 ASSERT_EQ(0, getgrnam_r("root", &grp_storage, buf, size, &grp)); in TEST()
358 check_group(grp, "root", 0); in TEST()