[Piglit] [PATCH 3/4] arb_copy_image-formats: exit loops upon pixel mismatch

Brian Paul brianp at vmware.com
Fri Sep 11 15:50:08 PDT 2015


Instead of printing potentially a thousand error messages when
there's a failure.

Also, some minor code reformatting.
---
 tests/spec/arb_copy_image/formats.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/tests/spec/arb_copy_image/formats.c b/tests/spec/arb_copy_image/formats.c
index 787194b..eb0f314 100644
--- a/tests/spec/arb_copy_image/formats.c
+++ b/tests/spec/arb_copy_image/formats.c
@@ -747,6 +747,7 @@ check_texture(GLuint texture, unsigned level,
 				fprintf(stdout, ".\n");
 
 				pass = false;
+				i = j = TEX_SIZE; /* exit loops upon error */
 			}
 		}
 	}
@@ -803,7 +804,9 @@ run_test(struct texture_format *src_format, struct texture_format *dst_format)
 	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
 	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
 	pass &= piglit_check_gl_error(GL_NO_ERROR);
-	if (!pass) goto cleanup;
+	if (!pass)
+		goto cleanup;
+
 	warn |= !check_texture(texture[0], src_level, src_format, src_data);
 
 	dst_width = TEX_SIZE * dst_format->block_width;
@@ -839,7 +842,9 @@ run_test(struct texture_format *src_format, struct texture_format *dst_format)
 	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
 	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
 	pass &= piglit_check_gl_error(GL_NO_ERROR);
-	if (!pass) goto cleanup;
+	if (!pass)
+		goto cleanup;
+
 	warn |= !check_texture(texture[1], dst_level, dst_format, dst_data);
 
 	glCopyImageSubData(texture[0], GL_TEXTURE_2D, src_level,
-- 
1.9.1



More information about the Piglit mailing list