public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH V9 1/2] syscalls/utimensat: Migrate to new test framework
Date: Mon, 10 Aug 2020 14:24:36 +0200	[thread overview]
Message-ID: <20200810122436.GA11869@yuki.lan> (raw)
In-Reply-To: <af2744945213682a2e378a275bd73ad174e2896a.1596799223.git.viresh.kumar@linaro.org>

Hi!
Pushed with a minor change, thanks.

I have moved the errno update to the setup with:

diff --git a/testcases/kernel/syscalls/utimensat/utimensat01.c b/testcases/kernel/syscalls/utimensat/utimensat01.c
index 617565e52..7e4fb9f25 100644
--- a/testcases/kernel/syscalls/utimensat/utimensat01.c
+++ b/testcases/kernel/syscalls/utimensat/utimensat01.c
@@ -104,12 +104,6 @@ static inline int sys_utimensat(int dirfd, const char *pathname,
 	return tst_syscall(__NR_utimensat, dirfd, pathname, times, flags);
 }
 
-static void setup(void)
-{
-	bad_addr = tst_get_bad_addr(NULL);
-	SAFE_MKDIR(TEST_DIR, 0700);
-}
-
 static void update_error(struct test_case *tc)
 {
 	if (tc->exp_err != -1)
@@ -171,8 +165,6 @@ static void run(unsigned int i)
 	void *tsp = NULL;
 	struct stat sb;
 
-	update_error(tc);
-
 	if (tc->dirfd != AT_FDCWD)
 		dfd = SAFE_OPEN(TEST_DIR, tc->oflags);
 
@@ -242,6 +234,17 @@ close:
 		SAFE_CLOSE(fd);
 }
 
+static void setup(void)
+{
+	size_t i;
+
+	bad_addr = tst_get_bad_addr(NULL);
+	SAFE_MKDIR(TEST_DIR, 0700);
+
+	for (i = 0; i < ARRAY_SIZE(tcase); i++)
+		update_error(&tcase[i]);
+}
+
 static struct tst_test test = {
 	.test = run,
 	.tcnt = ARRAY_SIZE(tcase),

-- 
Cyril Hrubis
chrubis@suse.cz

      parent reply	other threads:[~2020-08-10 12:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-07 11:24 [LTP] [PATCH V9 1/2] syscalls/utimensat: Migrate to new test framework Viresh Kumar
2020-08-07 11:24 ` [LTP] [PATCH V9 2/2] syscalls/utimensat: Add support for time64 tests Viresh Kumar
2020-08-10 12:24 ` Cyril Hrubis [this message]

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=20200810122436.GA11869@yuki.lan \
    --to=chrubis@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