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

Vinson Lee vlee at freedesktop.org
Sat Mar 5 00:15:51 UTC 2016


On Fri, Mar 4, 2016 at 3:05 PM, Dylan Baker <baker.dylan.c at gmail.com> wrote:
> 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>


An error message is already printed out earlier.
piglit_link_simple_program eventually calls piglit_link_check_status,
which prints out a link failure message.


More information about the Piglit mailing list