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 v2] tst_test_macros.h: Add TST_EXP_VAL macro
Date: Mon, 30 Aug 2021 16:17:27 +0200	[thread overview]
Message-ID: <YSzod9oVzf05LQbb@yuki> (raw)
In-Reply-To: <20210830070951.27803-1-zhanglianjie@uniontech.com>

Hi!
> +#define TST_EXP_VAL_SILENT_(SCALL, SSCALL, VAL, ...)                           \
> +	do {                                                                   \
> +		TEST(SCALL);                                                   \
> +		                                                               \
> +		TST_PASS = 0;                                                  \
> +		                                                               \
> +		if (TST_RET != VAL) {                                          \
> +			TST_MSGP_(TFAIL | TTERRNO, " retval not %ld",          \
> +			          (long )VAL, SSCALL, ##__VA_ARGS__);          \
> +			break;                                                 \
> +		}                                                              \
> +		                                                               \
> +		TST_PASS = 1;                                                  \
> +		                                                               \
> +	} while (0)
> +
> +#define TST_EXP_VAL_SILENT(SCALL, VAL, ...) TST_EXP_VAL_SILENT_(SCALL, #SCALL, VAL, ##__VA_ARGS__)
> +
> +#define TST_EXP_VAL(SCALL, VAL, ...)                                           \
> +	do {                                                                   \
> +		TST_EXP_VAL_SILENT(SCALL, VAL, ##__VA_ARGS__);                 \

Shouldn't we call the VAL_SILENT_() variant here and stringify the SCALL
here? Otherwise I guess that this will introduce the same problem I was
fixing in the "stringify early" patch.

Other than this it looks good.

-- 
Cyril Hrubis
chrubis@suse.cz

      parent reply	other threads:[~2021-08-30 14:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-30  7:09 [LTP] [PATCH v2] tst_test_macros.h: Add TST_EXP_VAL macro zhanglianjie
2021-08-30  9:55 ` Li Wang
2021-08-30 14:17 ` Cyril Hrubis [this message]

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=YSzod9oVzf05LQbb@yuki \
    --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