public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Ma Xinjian <maxj.fnst@fujitsu.com>, ltp@lists.linux.it, akumar@suse.de
Subject: Re: [LTP] [PATCH v2] set_tid_address01: refactor with new LTP API
Date: Thu, 9 Jan 2025 12:30:09 +0100	[thread overview]
Message-ID: <20250109113009.GA198463@pevik> (raw)
In-Reply-To: <20250109094235.GA184406@pevik>

> Hi Ma Xinjian, Avinesh,

> ...
> > +	TEST(tst_syscall(__NR_set_tid_address, &newtid));
> > +	if (TST_RET == getpid())
> > +		tst_res(TPASS, "set_tid_address call succeeded: as expected %ld", TST_RET);
> > +	else
> > +		tst_res(TFAIL | TTERRNO, "set_tid_address call failed: expected %d, but got %ld", getpid(), TST_RET);

> I wanted to replace this with:

> TST_EXP_EQ_LI(tst_syscall(__NR_set_tid_address, &newtid), getpid());

> But that TST_EXP_EQ_LI() not use TTERRNO.

> Maybe use this?

> 	TST_EXP_PID(tst_syscall(__NR_set_tid_address, &newtid));
> 	TST_EXP_EQ_LI(TST_RET, getpid());

OK, this is the correct one liner:
TST_EXP_VAL(tst_syscall(__NR_set_tid_address, &newtid), getpid());

Any objection to merge with change below?

Kind regards,
Petr

> Kind regards,
> Petr

+++ testcases/kernel/syscalls/set_tid_address/set_tid_address01.c
@@ -16,11 +16,7 @@ static void verify_set_tid_address(void)
 {
 	int newtid = -1;
 
-	TEST(tst_syscall(__NR_set_tid_address, &newtid));
-	if (TST_RET == getpid())
-		tst_res(TPASS, "set_tid_address call succeeded: as expected %ld", TST_RET);
-	else
-		tst_res(TFAIL | TTERRNO, "set_tid_address call failed: expected %d, but got %ld", getpid(), TST_RET);
+	TST_EXP_VAL(tst_syscall(__NR_set_tid_address, &newtid), getpid());
 }
 
 static struct tst_test test = {

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2025-01-09 11:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-19  6:57 [LTP] [PATCH v2] set_tid_address01: refactor with new LTP API Ma Xinjian via ltp
2025-01-09  9:42 ` Petr Vorel
2025-01-09 11:30   ` Petr Vorel [this message]
2025-01-10  8:53     ` Xinjian Ma (Fujitsu) via ltp
2025-01-10 10:59       ` 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=20250109113009.GA198463@pevik \
    --to=pvorel@suse.cz \
    --cc=akumar@suse.de \
    --cc=ltp@lists.linux.it \
    --cc=maxj.fnst@fujitsu.com \
    /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