All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH V2 resend 2/2] libs: sigwait: Get rid of REPORT_SUCCESS() macro
Date: Thu, 30 Jul 2020 17:34:17 +0200	[thread overview]
Message-ID: <20200730153417.GA17418@yuki.lan> (raw)
In-Reply-To: <ec86df91b3664ff7555717ac547d9e2c579d236a.1596035606.git.viresh.kumar@linaro.org>

Hi!
>  	SAFE_KILL(child, SIGTERM);
>  	SAFE_WAIT(NULL);
> @@ -78,7 +52,14 @@ void test_timeout(swi_func sigwaitinfo, int signo, enum tst_ts_type type)
>  	child = create_sig_proc(signo, INT_MAX, 100000);
>  
>  	TEST(sigwaitinfo(&sigs, &si, tst_ts_get(&ts)));
> -	REPORT_SUCCESS(-1, EAGAIN);
> +	if (TST_RET == -1) {
> +		if (TST_ERR == EAGAIN)
> +			tst_res(TPASS, "Wait interrupted by a signal");

Can we please fix these messages as well so that it's not copy & paste
of the same message all over?

This one should say "Wait interrupted by a timeout"

> +		else
> +			tst_res(TFAIL | TTERRNO, "Expected error number EAGAIN, got");
> +	} else {
> +		tst_res(TFAIL, "Expected return value -1, got: %ld", TST_RET);
> +	}
>  
>  	SAFE_KILL(child, SIGTERM);
>  	SAFE_WAIT(NULL);
> @@ -101,9 +82,15 @@ void test_unmasked_matching(swi_func sigwaitinfo, int signo,
>  	child = create_sig_proc(signo, INT_MAX, 100000);
>  
>  	TEST(sigwaitinfo(&sigs, &si, NULL));
> -	REPORT_SUCCESS_COND(signo, 0, si.si_pid == child
> -			    && si.si_code == SI_USER
> -			    && si.si_signo == signo, "Struct siginfo mismatch");
> +	if (TST_RET == signo) {
> +		if (si.si_pid == child && si.si_code == SI_USER &&
> +		    si.si_signo == signo)
> +			tst_res(TPASS, "Wait interrupted by a signal");

And this one "struct siginfo is correct"


etc.

-- 
Cyril Hrubis
chrubis@suse.cz

  reply	other threads:[~2020-07-30 15:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-27  9:40 [LTP] [PATCH V2 1/2] libs: sigwait: Fix compilation warning around sigprocmask() Viresh Kumar
2020-07-27  9:40 ` [LTP] [PATCH V2 2/2] libs: sigwait: Get rid of REPORT_SUCCESS() macro Viresh Kumar
2020-07-29 14:40   ` Cyril Hrubis
2020-07-29 15:13     ` Viresh Kumar
2020-07-30 15:25       ` Cyril Hrubis
2020-07-28 13:02 ` [LTP] [PATCH V2 1/2] libs: sigwait: Fix compilation warning around sigprocmask() Cyril Hrubis
2020-07-29 12:55 ` [LTP] [PATCH V3 " Viresh Kumar
2020-07-29 14:39   ` Cyril Hrubis
2020-07-29 15:13 ` [LTP] [PATCH V2 resend 2/2] libs: sigwait: Get rid of REPORT_SUCCESS() macro Viresh Kumar
2020-07-30 15:34   ` Cyril Hrubis [this message]
2020-08-04  7:57 ` [LTP] [PATCH V3 " Viresh Kumar
2020-08-06 12:26   ` Cyril Hrubis

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=20200730153417.GA17418@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.