[LTP] [PATCH v4 1/2] Add silent macros for TST_EXP_EQ_*

Cyril Hrubis chrubis@suse.cz
Tue Sep 10 17:26:59 CEST 2024


Hi!
> +#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;                                                         \
> +	}                                                                      \
> +                                                                               \

I would probably do here:

	} else {
		TST_PASS = 1;
	}

Because it's a bit more readable.

Also you did messed up the alignment of the \ at the end.


Apart from these minor things I do not see anything wrong here.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list