[igt-dev] [PATCH i-g-t] tests/vc4_purgeable_bo: Fix conditional assertion

Kamil Konieczny kamil.konieczny at linux.intel.com
Mon Apr 3 12:05:03 UTC 2023


On 2023-01-04 at 10:29:27 -0300, Maíra Canal wrote:
> Currently, the assertion is outside of the conditional block, causing a
> failure in two sub-tests as the return of setjmp() can be 0 or SIGBUS.
> Therefore, create an else hook for the igt_assert(ret == SIGBUS) in
> order to avoid a failure of the tests.
> 
> Signed-off-by: Maíra Canal <mcanal at igalia.com>

Reviewed-by: Kamil Konieczny <kamil.konieczny at linux.intel.com>

> ---
>  tests/vc4/vc4_purgeable_bo.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/vc4/vc4_purgeable_bo.c b/tests/vc4/vc4_purgeable_bo.c
> index 676bc1f3..7f24590c 100644
> --- a/tests/vc4/vc4_purgeable_bo.c
> +++ b/tests/vc4/vc4_purgeable_bo.c
> @@ -187,7 +187,8 @@ igt_main
>  		ret = setjmp(jmp);
>  		if (!ret)
>  			*map = 0;
> -		igt_assert(ret == SIGBUS);
> +		else
> +			igt_assert(ret == SIGBUS);
>  		signal(SIGBUS, SIG_DFL);
>  		signal(SIGSEGV, SIG_DFL);
>  		igt_vc4_purgeable_bo(fd, bo->handle, false);
> @@ -230,7 +231,8 @@ igt_main
>  		ret = setjmp(jmp);
>  		if (!ret)
>  			*map = 0;
> -		igt_assert(ret == SIGBUS);
> +		else
> +			igt_assert(ret == SIGBUS);
>  		signal(SIGBUS, SIG_DFL);
>  		signal(SIGSEGV, SIG_DFL);
>  	}
> -- 
> 2.39.0
> 


More information about the igt-dev mailing list