[Piglit] [PATCH] glx-shader-sharing: Report failure instead of crash on assert.

Dylan Baker baker.dylan.c at gmail.com
Fri Mar 4 23:05:35 UTC 2016


Quoting Vinson Lee (2016-03-04 14:48:12)
> Signed-off-by: Vinson Lee <vlee at freedesktop.org>
> ---
>  tests/glx/glx-shader-sharing.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/glx/glx-shader-sharing.c b/tests/glx/glx-shader-sharing.c
> index 1a022c09e0e5..b8df9b4c8706 100644
> --- a/tests/glx/glx-shader-sharing.c
> +++ b/tests/glx/glx-shader-sharing.c
> @@ -102,7 +102,9 @@ draw(Display *dpy)
>     frag_shader = piglit_compile_shader_text(GL_FRAGMENT_SHADER, frag_shader_text);
>     program = piglit_link_simple_program(vert_shader, frag_shader);
>     check_error(__LINE__);
> -   assert(program);
> +   if (!program) {
> +      piglit_report_result(PIGLIT_FAIL);
> +   }
>  
>     glUseProgram(program);
>     check_error(__LINE__);
> -- 
> 2.5.0
> 
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit

I'm hardly an authority, but I would think adding a printf here for the
reason the test failed would be helpful.

With that change:
Reviewed-by: Dylan Baker <baker.dylan.c at gmail.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: signature
URL: <https://lists.freedesktop.org/archives/piglit/attachments/20160304/19b18aee/attachment.sig>


More information about the Piglit mailing list