public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: Andrea Cervesato <andrea.cervesato@suse.de>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v5 1/2] Add silent macros for TST_EXP_EQ_*
Date: Wed, 11 Sep 2024 15:44:58 +0200	[thread overview]
Message-ID: <ZuGe2gxREw2kKVfJ@yuki.lan> (raw)
In-Reply-To: <20240911-fcntl4_refactoring-v5-1-948401e7131c@suse.com>

Hi!
> TST_EXP_EQ_LI_SILENT
> TST_EXP_EQ_LU_SILENT
> TST_EXP_EQ_SZ_SILENT
> TST_EXP_EQ_SSI_SILENT
> 
> Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
> ---
>  include/tst_test_macros.h | 81 ++++++++++++++++++++++++++++++++++++-----------
>  1 file changed, 62 insertions(+), 19 deletions(-)
> 
> diff --git a/include/tst_test_macros.h b/include/tst_test_macros.h
> index 7a443c803..4217700f3 100644
> --- a/include/tst_test_macros.h
> +++ b/include/tst_test_macros.h
> @@ -344,29 +344,72 @@ const char *tst_errno_names(char *buf, const int *exp_errs, int exp_errs_cnt);
>         tst_res_(__FILE__, __LINE__, (EXPR) ? TPASS : TFAIL, "Expect: "       \
>                  TST_FMT_(TST_2_(dummy, ##__VA_ARGS__, #EXPR), __VA_ARGS__));
>  
> -#define TST_EXP_EQ_(VAL_A, SVAL_A, VAL_B, SVAL_B, TYPE, PFS) do {\
> -	TYPE tst_tmp_a__ = VAL_A; \
> -	TYPE tst_tmp_b__ = VAL_B; \
> -	if (tst_tmp_a__ == tst_tmp_b__) { \
> -		tst_res_(__FILE__, __LINE__, TPASS, \
> -			SVAL_A " == " SVAL_B " (" PFS ")", tst_tmp_a__); \
> -	} else { \
> -		tst_res_(__FILE__, __LINE__, TFAIL, \
> -			SVAL_A " (" PFS ") != " SVAL_B " (" PFS ")", \
> -			tst_tmp_a__, tst_tmp_b__); \
> -	} \
> +#define TST_EXP_EQ_SILENT_(VAL_A, SVAL_A, VAL_B, SVAL_B, TYPE, PFS) do {       \
> +	TYPE tst_tmp_a__ = VAL_A;                                              \
> +	TYPE tst_tmp_b__ = VAL_B;                                              \
> +                                                                               \
> +	TST_PASS = 0;                                                          \
> +                                                                               \
> +	if (tst_tmp_a__ != tst_tmp_b__) {                                      \
> +		tst_res_(__FILE__, __LINE__, TFAIL,                            \
> +			SVAL_A " (" PFS ") != " SVAL_B " (" PFS ")",           \
> +			tst_tmp_a__, tst_tmp_b__);                             \
> +		break;                                                         \

No need for the break here now.

Otherwise: Reviewed-by: Cyril Hrubis <chrubis@suse.cz>

-- 
Cyril Hrubis
chrubis@suse.cz

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

  reply	other threads:[~2024-09-11 13:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-11  8:05 [LTP] [PATCH v5 0/2] fcntl14 refactoring Andrea Cervesato
2024-09-11  8:06 ` [LTP] [PATCH v5 1/2] Add silent macros for TST_EXP_EQ_* Andrea Cervesato
2024-09-11 13:44   ` Cyril Hrubis [this message]
2024-09-11 14:42     ` Andrea Cervesato via ltp
2024-09-11  8:06 ` [LTP] [PATCH v5 2/2] Rewrite fcnt14 test Andrea Cervesato
2024-09-11 13:51   ` 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=ZuGe2gxREw2kKVfJ@yuki.lan \
    --to=chrubis@suse.cz \
    --cc=andrea.cervesato@suse.de \
    --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