[Piglit] [PATCH] s3tc-errors: Check all return values of piglit_check_gl_error.
Vinson Lee
vlee at freedesktop.org
Sat Jan 18 21:13:40 PST 2014
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
More information about the Piglit
mailing list