[LTP] [PATCH V2 resend 2/2] libs: sigwait: Get rid of REPORT_SUCCESS() macro

Cyril Hrubis chrubis@suse.cz
Thu Jul 30 17:34:17 CEST 2020


Hi!
>  	SAFE_KILL(child, SIGTERM);
>  	SAFE_WAIT(NULL);
> @@ -78,7 +52,14 @@ void test_timeout(swi_func sigwaitinfo, int signo, enum tst_ts_type type)
>  	child = create_sig_proc(signo, INT_MAX, 100000);
>  
>  	TEST(sigwaitinfo(&sigs, &si, tst_ts_get(&ts)));
> -	REPORT_SUCCESS(-1, EAGAIN);
> +	if (TST_RET == -1) {
> +		if (TST_ERR == EAGAIN)
> +			tst_res(TPASS, "Wait interrupted by a signal");

Can we please fix these messages as well so that it's not copy & paste
of the same message all over?

This one should say "Wait interrupted by a timeout"

> +		else
> +			tst_res(TFAIL | TTERRNO, "Expected error number EAGAIN, got");
> +	} else {
> +		tst_res(TFAIL, "Expected return value -1, got: %ld", TST_RET);
> +	}
>  
>  	SAFE_KILL(child, SIGTERM);
>  	SAFE_WAIT(NULL);
> @@ -101,9 +82,15 @@ void test_unmasked_matching(swi_func sigwaitinfo, int signo,
>  	child = create_sig_proc(signo, INT_MAX, 100000);
>  
>  	TEST(sigwaitinfo(&sigs, &si, NULL));
> -	REPORT_SUCCESS_COND(signo, 0, si.si_pid == child
> -			    && si.si_code == SI_USER
> -			    && si.si_signo == signo, "Struct siginfo mismatch");
> +	if (TST_RET == signo) {
> +		if (si.si_pid == child && si.si_code == SI_USER &&
> +		    si.si_signo == signo)
> +			tst_res(TPASS, "Wait interrupted by a signal");

And this one "struct siginfo is correct"


etc.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list