[LTP] [PATCH v3] ipc/shmctl02: Make use of TST_EXP_FAIL()

Vinay Kumar vinay.m.engg@gmail.com
Mon Jun 14 17:55:16 CEST 2021


Hi Cyril,

Could you please review below test cases changes also,

semctl03.c
https://lists.linux.it/pipermail/ltp/2021-June/023116.html

shmctl02.c
https://lists.linux.it/pipermail/ltp/2021-June/023118.html
https://lists.linux.it/pipermail/ltp/2021-June/023166.html

Regards,
Vinay

On Sun, Jun 13, 2021 at 11:19 PM Vinay Kumar <vinay.m.engg@gmail.com> wrote:
>
> In order to simplify the code a bit.
>
> Signed-off-by: Vinay Kumar <vinay.m.engg@gmail.com>
> ---
>  testcases/kernel/syscalls/ipc/shmctl/shmctl02.c | 17 ++---------------
>  1 file changed, 2 insertions(+), 15 deletions(-)
>
> diff --git a/testcases/kernel/syscalls/ipc/shmctl/shmctl02.c b/testcases/kernel/syscalls/ipc/shmctl/shmctl02.c
> index b9a71722d..9841d3a86 100644
> --- a/testcases/kernel/syscalls/ipc/shmctl/shmctl02.c
> +++ b/testcases/kernel/syscalls/ipc/shmctl/shmctl02.c
> @@ -96,21 +96,8 @@ static void verify_shmctl(unsigned int i)
>                 return;
>         }
>
> -       TEST(tv->shmctl(*(tc[i].shm_id), tc[i].cmd, tc[i].buf));
> -
> -       if (TST_RET != -1) {
> -               tst_res(TFAIL, "shmctl() returned %li", TST_RET);
> -               return;
> -       }
> -
> -       if (TST_ERR == tc[i].error) {
> -               tst_res(TPASS | TTERRNO, "shmctl(%i, %i, %p)",
> -                               *tc[i].shm_id, tc[i].cmd, tc[i].buf);
> -               return;
> -       }
> -
> -       tst_res(TFAIL | TTERRNO, "shmctl(%i, %i, %p) expected %s",
> -               *tc[i].shm_id, tc[i].cmd, tc[i].buf, tst_strerrno(tc[i].error));
> +       TST_EXP_FAIL(tv->shmctl(*(tc[i].shm_id), tc[i].cmd, tc[i].buf),
> +               tc[i].error, "shmctl(%i, %i, %p)", *(tc[i].shm_id), tc[i].cmd, tc[i].buf);
>  }
>
>  static void setup(void)
> --
> 2.17.1
>


More information about the ltp mailing list