[LTP] [PATCH] syscalls/unlinkat01: Bugfix and update to new API

Petr Vorel pvorel@suse.cz
Thu May 6 07:30:12 CEST 2021


Hi Gongyi,

> Hi Petr,

> Thanks for your review!
yw :)

> > > -char *TCID = "unlinkat01";
> > > -int TST_TOTAL = TEST_CASES;
> > > -
> > >  static const char pathname[] = "unlinkattestdir",
> > >  		  subpathname[] = "unlinkatsubtestdir",
> > >  		  subpathdir[] = "unlinkattestdir/unlinkatsubtestdir",
> > > @@ -65,82 +41,79 @@ static const int flags[] = { 0, 0, 0, 0, 9999, 0,
> > > AT_REMOVEDIR };

> > Could you please use static struct for testcases data which is the usual way
> > in LTP instead of using arrays? (e.g. in
> > testcases/kernel/syscalls/access/access02.c).
> > It helps to the readability of the code as we'll be able to remove lines like:
> > 	fds[1] = fds[4] = fds[6] = fds[0];

> > and most of the setup.

> > Than you can then drop also TEST_CASES.

> It is more clearer that using arrays, but in this case, fds and filenames can not be complete initialized at first, so it seems there are some trouble to cleanup,

> Chould you give me some suggestions for it?
How about adding functions to setup things and have pointer to the functions?
See examples in testcases/kernel/syscalls/chmod/chmod06.c
or testcases/kernel/syscalls/clone/clone08.c

Kind regards,
Petr


More information about the ltp mailing list