public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: Petr Vorel <pvorel@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 1/1] tst_test_macros.h: Print also returned value
Date: Tue, 21 Dec 2021 13:14:18 +0100	[thread overview]
Message-ID: <YcHFGga1tl8OS+xw@yuki> (raw)
In-Reply-To: <20211220195111.24580-1-pvorel@suse.cz>

Hi!
> in TST_EXP_VAL*() macros.
> 
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
> NOTE: tst_test_macros.h would also deserve documentation of "public"
> macros (to save people read all nested definitions.
> 
> Kind regards,
> Petr
> 
>  include/tst_test_macros.h | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/include/tst_test_macros.h b/include/tst_test_macros.h
> index 4a023b700a..dd959cad63 100644
> --- a/include/tst_test_macros.h
> +++ b/include/tst_test_macros.h
> @@ -46,6 +46,10 @@ extern void *TST_RET_PTR;
>  	tst_res_(__FILE__, __LINE__, RES, \
>  		TST_FMT_(TST_2_(dummy, ##__VA_ARGS__, SCALL) FMT, __VA_ARGS__), PAR)
>  
> +#define TST_MSGP2_(RES, FMT, PAR, PAR2, SCALL, ...) \
> +	tst_res_(__FILE__, __LINE__, RES, \
> +		TST_FMT_(TST_2_(dummy, ##__VA_ARGS__, SCALL) FMT, __VA_ARGS__), PAR, PAR2)
> +
>  #define TST_EXP_POSITIVE_(SCALL, SSCALL, ...)                                  \
>  	do {                                                                   \
>  		TEST(SCALL);                                                   \
> @@ -107,8 +111,8 @@ extern void *TST_RET_PTR;
>  		TST_PASS = 0;                                                  \
>  		                                                               \
>  		if (TST_RET != VAL) {                                          \
> -			TST_MSGP_(TFAIL | TTERRNO, " retval not %ld",          \
> -			          (long )VAL, SSCALL, ##__VA_ARGS__);          \
> +			TST_MSGP2_(TFAIL | TTERRNO, " retval not %ld (%ld)",          \
                                                          ^
					Should probably be " retval %ld != %ld", TST_RET, (long)VAL, ...

> +			          (long)VAL, TST_RET, SSCALL, ##__VA_ARGS__);          \
>  			break;                                                 \
>  		}                                                              \
>  		                                                               \

Other than this it looks fine.

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2021-12-21 12:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-20 19:51 [LTP] [PATCH 1/1] tst_test_macros.h: Print also returned value Petr Vorel
2021-12-21 12:14 ` Cyril Hrubis [this message]
2021-12-21 12:51   ` 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=YcHFGga1tl8OS+xw@yuki \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    --cc=pvorel@suse.cz \
    /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