[LTP] [PATCH 1/1] tst_test_macros.h: Print also returned value
Cyril Hrubis
chrubis@suse.cz
Tue Dec 21 13:14:18 CET 2021
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
More information about the ltp
mailing list