Re: [LTP] [PATCH v2] set_tid_address01: refactor with new LTP API

Xinjian Ma (Fujitsu) via ltp
2025-01-10T08:53:59Z

Hi Petr

> > 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?

Looks good.

Best regards
Ma