[Piglit] [PATCH] gl-3.2-depth-tex-sampling: Check return value of piglit_check_gl_error.
Brian Paul
brian.e.paul at gmail.com
Thu Jan 30 08:06:14 PST 2014
On Wed, Jan 29, 2014 at 9:41 PM, Vinson Lee <vlee at freedesktop.org> wrote:
> Fixes "Unchecked return value" defects reported by Coverity.
>
> Signed-off-by: Vinson Lee <vlee at freedesktop.org>
> ---
> tests/spec/gl-3.2/depth-tex-sampling.c | 12 +++++++++---
> 1 file changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/tests/spec/gl-3.2/depth-tex-sampling.c
> b/tests/spec/gl-3.2/depth-tex-sampling.c
> index a7def6c..89827ba 100644
> --- a/tests/spec/gl-3.2/depth-tex-sampling.c
> +++ b/tests/spec/gl-3.2/depth-tex-sampling.c
> @@ -73,7 +73,9 @@ make_depth_texture(void)
> TEX_SIZE, TEX_SIZE, 0,
> format, GL_FLOAT, texels);
>
> - piglit_check_gl_error(GL_NO_ERROR);
> + if (!piglit_check_gl_error(GL_NO_ERROR)) {
> + piglit_report_result(PIGLIT_FAIL);
> + }
>
> /* this call should generate an error in the core profile */
> glTexParameteri(GL_TEXTURE_2D, GL_DEPTH_TEXTURE_MODE,
> GL_INTENSITY);
> @@ -124,7 +126,9 @@ make_shader_program(void)
>
> glLinkProgram(prog);
>
> - piglit_check_gl_error(GL_NO_ERROR);
> + if (!piglit_check_gl_error(GL_NO_ERROR)) {
> + piglit_report_result(PIGLIT_FAIL);
> + }
>
> return prog;
> }
> @@ -156,7 +160,9 @@ make_vao(void)
> glEnableVertexAttribArray(0);
> glEnableVertexAttribArray(1);
>
> - piglit_check_gl_error(GL_NO_ERROR);
> + if (!piglit_check_gl_error(GL_NO_ERROR)) {
> + piglit_report_result(PIGLIT_FAIL);
> + }
>
> return vbo;
> }
>
I think I had those calls in there just as sanity checks during
development. They could probably be dropped, but your patch is fine too.
Reviewed-by: Brian Paul <brianp at vmware.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20140130/61490448/attachment.html>
More information about the Piglit
mailing list