[LTP] [PATCH v2 01/10] getitimer02 : Convert getitimer02 to new API

Cyril Hrubis chrubis@suse.cz
Fri Jun 11 15:41:43 CEST 2021


Hi!
>  		/* call with a bad address */
>  		TEST(getitimer(ITIMER_REAL, (struct itimerval *)-1));
>  

Can we please make use of TST_EXP_FAIL() here instead?

> -		if (TEST_RETURN == 0) {
> -			tst_resm(TFAIL, "call failed to produce "
> -				 "expected error - errno = %d - %s",
> -				 TEST_ERRNO, strerror(TEST_ERRNO));
> -			continue;
> +		if (TST_RET == 0) {
> +			tst_res(TFAIL, "call failed to produce "
> +				"expected error - errno = %d - %s",
> +				TST_ERR, strerror(TST_ERR));
>  		}
>  
> -		switch (TEST_ERRNO) {
> +		switch (TST_ERR) {
>  		case EFAULT:
> -			tst_resm(TPASS, "expected failure - errno = %d - %s",
> -				 TEST_ERRNO, strerror(TEST_ERRNO));
> +			tst_res(TPASS, "expected failure - errno = %d - %s",
> +				 TST_ERR, strerror(TST_ERR));
>  			break;
>  		default:
> -			tst_resm(TFAIL, "call failed to produce "
> -				 "expected error - errno = %d - %s",
> -				 TEST_ERRNO, strerror(TEST_ERRNO));
> +			tst_res(TFAIL, "call failed to produce "
> +					"expected error - errno = %d - %s",
> +					TST_ERR, strerror(TST_ERR));

And can we please have a proper indentation here from the start instead
of fixing that in subsequent patches?

> -#endif /* if !defined(UCLINUX) */
> +static struct tst_test test = {
> +			.test_all = verify_getitimer,
> +			.needs_root = 1,

And here as well.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list