[LTP] [PATCH v1 3/4] syscalls/pidfd_send_signal02

Cyril Hrubis chrubis@suse.cz
Tue May 28 13:38:47 CEST 2019


Hi!
> +static void verify_pidfd_send_signal(unsigned int n)
> +{
> +	struct tcase *tc = &tcases[n];
> +
> +	TEST(tst_pidfd_send_signal(*tc->fd, tc->signal, tc->siginf, tc->flags));
> +	if (tc->exp_err != TST_ERR) {
> +		tst_res(TFAIL | TTERRNO,
> +			"pidfd_send_signal() did not fail with %s but",
> +			tst_strerrno(tc->exp_err));
> +		return;
> +	}
> +
> +	tst_res(TPASS,
> +		"pidfd_send_signal() failed as expected!");

I tend to pass TTERRNO to the passing message for negative testcases
like this one so that the output has some information about what has
been tested.

I would have done something as here:

	tst_res(TPASS | TTERRNO, "pidfd_send_signal() failed");

Other than this the test looks good.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list