[Piglit] [PATCH] s3tc-errors: Check all return values of piglit_check_gl_error.

Chris Forbes chrisf at ijw.co.nz
Sat Jan 18 23:13:29 PST 2014


Reviewed-by: Chris Forbes <chrisf at ijw.co.nz>

On Sun, Jan 19, 2014 at 6:13 PM, Vinson Lee <vlee at freedesktop.org> wrote:
> Fixes "Dead assignment" bug reported by Clang Static Analyzer.
>
> Signed-off-by: Vinson Lee <vlee at freedesktop.org>
> ---
>  tests/texturing/s3tc-errors.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/tests/texturing/s3tc-errors.c b/tests/texturing/s3tc-errors.c
> index 5109697..710625c 100644
> --- a/tests/texturing/s3tc-errors.c
> +++ b/tests/texturing/s3tc-errors.c
> @@ -345,7 +345,7 @@ test_format(int width, int height, GLfloat *image, GLenum format)
>  static bool
>  test_small_mipmap_level(void)
>  {
> -       bool pass;
> +       bool pass = true;
>         GLuint tex;
>         GLubyte buf[100];
>         int width, height;
> @@ -363,13 +363,13 @@ test_small_mipmap_level(void)
>                         glTexImage2D(GL_TEXTURE_2D, 0, format, width, height,
>                                      0, GL_RGBA, GL_UNSIGNED_BYTE, buf);
>
> -                       pass = piglit_check_gl_error(GL_NO_ERROR);
> +                       pass = piglit_check_gl_error(GL_NO_ERROR) && pass;
>
>                         /* Try TexSubImage of whole texture */
>                         glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, width, height,
>                                         GL_RGBA, GL_UNSIGNED_BYTE, buf);
>
> -                       pass = piglit_check_gl_error(GL_NO_ERROR);
> +                       pass = piglit_check_gl_error(GL_NO_ERROR) && pass;
>                 }
>         }
>
> --
> 1.8.3.2
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit


More information about the Piglit mailing list