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

Dylan Baker baker.dylan.c at gmail.com
Sat Mar 5 01:21:38 UTC 2016


Quoting Vinson Lee (2016-03-04 16:15:51)
> 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.

I guess I didn't read piglit_link_simple_program closely enough.

You can have my r-b as-is then.
-------------- 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/a000b2c6/attachment.sig>


More information about the Piglit mailing list