[LTP] [PATCH v1 1/2] Refactor getegid01 using new LTP API

Cyril Hrubis chrubis@suse.cz
Fri Sep 1 14:21:04 CEST 2023


Hi!
> >> +	TST_EXP_EQ_LI(gid, st_egid);
> > So the code here should really do:
> >
> > 	if (GID16_CHECK(st_egid))
> > 		TST_EXP_EQ_LI(gid, st_egid);
> > 	else
> > 		tst_res(TPASS, "getgid() passed");
> 
> Mmmh, this would make sense if GID16_CHECK only checked for 16bit 
> compatibility, because at the moment it's way different:
> 
> 
> #define GID16_CHECK(gid, sys_name, cleanup) \
> if (!GID_SIZE_CHECK(gid)) { \
>      tst_brkm(TBROK, cleanup, \
>          "gid %d of %s is too large for testing 16-bit version " \
>          "of %s()", gid, #gid, #sys_name); \
> }
> 
> Am I missing something?

It seems that I confused GID16_CHECK with GID_SIZE_CHECK(), so it should
have been:

	if (GID_SIZE_CHECK(st_egid))

> > Which skips the check on 16bit syscall in the case that the GID
> > overflows 16bit, however we still have to report at least single TPASS
> > otherwise the test will be failed by the test library.
> >
> >>   }
> >>   
> >> -static void cleanup(void)
> >> -{
> >> -}
> >> +static struct tst_test test = {
> >> +	.test_all = run,
> >> +};
> >> -- 
> >> 2.35.3
> >>
> >>
> >> -- 
> >> Mailing list info: https://lists.linux.it/listinfo/ltp
> 
> Andrea
> 

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list