public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 4/4] libs: sigwait: Get rid of REPORT_SUCCESS() macro
Date: Fri, 24 Jul 2020 14:32:35 +0200	[thread overview]
Message-ID: <20200724123235.GA3539@yuki.lan> (raw)
In-Reply-To: <a83166af3a2b432bb11a0876e18e15705479f32d.1595511710.git.viresh.kumar@linaro.org>

Hi!
>  void test_empty_set(swi_func sigwaitinfo, int signo,
>  		    enum tst_ts_type type LTP_ATTRIBUTE_UNUSED)
>  {
> @@ -55,7 +22,15 @@ void test_empty_set(swi_func sigwaitinfo, int signo,
>  	child = create_sig_proc(signo, INT_MAX, 100000);
>  
>  	TEST(sigwaitinfo(&sigs, &si, NULL));
> -	REPORT_SUCCESS(-1, EINTR);
> +	if (TST_RET == -1) {
> +		if (TST_ERR == EINTR)
> +			tst_res(TPASS, "%s: Test passed", __func__);
> +		else
> +			tst_res(TFAIL | TTERRNO, "%s: Unexpected failure", __func__);

Can we please make the messages a bit more user friendly?

- the tst_res() already prints line and filename the __func__ is a bit
  redundant

- it also prints PASS/FAIL so we can omit the "Test passed" we can print
  something that describes the testcase instead e.g.
  "Wait interrupted by a signal"

- also in the "Unexpected failure" case we should print which error we
  expected with someting as: tst_res(TFAIL | TTERRNO, "Expected to return EINTER, got");

-- 
Cyril Hrubis
chrubis@suse.cz

  parent reply	other threads:[~2020-07-24 12:32 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-23 13:42 [LTP] [PATCH 1/4] libs: sigwait: Use SAFE_FORK() Viresh Kumar
2020-07-23 13:42 ` [LTP] [PATCH 2/4] libs: sigwait: Add SAFE_SIG*() macros Viresh Kumar
2020-07-24  5:51   ` Petr Vorel
2020-07-24  8:43   ` Cyril Hrubis
2020-07-23 13:42 ` [LTP] [PATCH 3/4] libs: sigwait: Remove alarm() from setup() and cleanup() Viresh Kumar
2020-07-24  5:52   ` Petr Vorel
2020-07-24  8:44   ` Cyril Hrubis
2020-07-23 13:42 ` [LTP] [PATCH 4/4] libs: sigwait: Get rid of REPORT_SUCCESS() macro Viresh Kumar
2020-07-24  5:58   ` Petr Vorel
2020-07-24 10:34     ` Viresh Kumar
2020-07-24 12:20       ` Cyril Hrubis
2020-07-24 13:37       ` Petr Vorel
2020-07-24 12:32   ` Cyril Hrubis [this message]
2020-07-24 13:35     ` Petr Vorel
2020-07-24  5:49 ` [LTP] [PATCH 1/4] libs: sigwait: Use SAFE_FORK() 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=20200724123235.GA3539@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox