Linux Test Project
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] syscalls/unlinkat01: Bugfix and update to new API
Date: Thu, 6 May 2021 07:30:12 +0200	[thread overview]
Message-ID: <YJN+5P2lUWi0gX5K@pevik> (raw)
In-Reply-To: <ebf341b8fdd0424aae31204b4376d559@huawei.com>

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

  reply	other threads:[~2021-05-06  5:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-06  3:35 [LTP] [PATCH] syscalls/unlinkat01: Bugfix and update to new API zhaogongyi
2021-05-06  5:30 ` Petr Vorel [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-05-06  9:35 zhaogongyi
2021-04-28  3:55 Zhao Gongyi
2021-05-03 12:21 ` Petr Vorel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YJN+5P2lUWi0gX5K@pevik \
    --to=pvorel@suse.cz \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox