[Piglit] [PATCH] Replaced calls from assert(glGetError()==0) with piglit_check_gl_error()

Juliet Fru julietfru at gmail.com
Fri Oct 17 16:44:42 PDT 2014


From: Juliet Fru <julietfru at gmail.com>

---
 tests/bugs/fdo14575.c                                      |  6 +++---
 tests/fbo/fbo-1d.c                                         |  4 ++--
 tests/fbo/fbo-3d.c                                         |  4 ++--
 tests/fbo/fbo-alpha.c                                      |  2 +-
 tests/fbo/fbo-alphatest-formats.c                          |  2 +-
 tests/fbo/fbo-alphatest-nocolor-ff.c                       |  4 ++--
 tests/fbo/fbo-alphatest-nocolor.c                          |  4 ++--
 tests/fbo/fbo-array.c                                      |  6 +++---
 tests/fbo/fbo-blending-formats.c                           |  2 +-
 tests/fbo/fbo-blit-d24s8.c                                 |  6 +++---
 tests/fbo/fbo-blit-stretch.cpp                             |  2 +-
 tests/fbo/fbo-blit.c                                       |  2 +-
 tests/fbo/fbo-clearmipmap.c                                |  4 ++--
 tests/fbo/fbo-colormask-formats.c                          |  2 +-
 tests/fbo/fbo-copypix.c                                    |  2 +-
 tests/fbo/fbo-copyteximage-simple.c                        |  4 ++--
 tests/fbo/fbo-copyteximage.c                               |  4 ++--
 tests/fbo/fbo-cubemap.c                                    |  4 ++--
 tests/fbo/fbo-depth-array.c                                | 14 +++++++-------
 tests/fbo/fbo-depth-sample-compare.c                       |  8 ++++----
 tests/fbo/fbo-depth-tex1d.c                                |  6 +++---
 tests/fbo/fbo-depth.c                                      |  2 +-
 tests/fbo/fbo-depthstencil.c                               |  2 +-
 tests/fbo/fbo-drawbuffers-arbfp.c                          |  2 +-
 tests/fbo/fbo-drawbuffers-blend-add.c                      |  2 +-
 tests/fbo/fbo-drawbuffers-fragcolor.c                      |  2 +-
 tests/fbo/fbo-drawbuffers-maxtargets.c                     |  2 +-
 tests/fbo/fbo-drawbuffers.c                                |  2 +-
 tests/fbo/fbo-drawbuffers2-blend.c                         |  2 +-
 tests/fbo/fbo-drawbuffers2-colormask.c                     |  2 +-
 tests/fbo/fbo-finish-deleted.c                             |  2 +-
 tests/fbo/fbo-flushing-2.c                                 |  2 +-
 tests/fbo/fbo-flushing.c                                   |  2 +-
 tests/fbo/fbo-fragcoord.c                                  |  6 +++---
 tests/fbo/fbo-generatemipmap-array.c                       | 12 ++++++------
 tests/fbo/fbo-generatemipmap-formats.c                     |  6 +++---
 tests/fbo/fbo-generatemipmap-nonsquare.c                   |  4 ++--
 tests/fbo/fbo-generatemipmap-npot.c                        |  4 ++--
 tests/fbo/fbo-generatemipmap-scissor.c                     |  4 ++--
 tests/fbo/fbo-generatemipmap-swizzle.c                     |  4 ++--
 tests/fbo/fbo-generatemipmap-viewport.c                    |  4 ++--
 tests/fbo/fbo-generatemipmap.c                             |  4 ++--
 tests/fbo/fbo-luminance-alpha.c                            |  2 +-
 tests/fbo/fbo-maxsize.c                                    |  2 +-
 tests/fbo/fbo-nodepth-test.c                               |  2 +-
 tests/fbo/fbo-nostencil-test.c                             |  2 +-
 tests/fbo/fbo-pbo-readpixels-small.c                       |  2 +-
 tests/fbo/fbo-readdrawpix.c                                |  2 +-
 tests/fbo/fbo-readpixels-depth-formats.c                   |  2 +-
 tests/fbo/fbo-readpixels.c                                 |  2 +-
 tests/fbo/fbo-rg.c                                         |  4 ++--
 tests/fbo/fbo-srgb.c                                       |  4 ++--
 tests/fbo/fbo-stencil.c                                    |  2 +-
 tests/fbo/fbo-viewport.c                                   |  2 +-
 tests/general/attribs.c                                    |  2 +-
 tests/general/draw-elements.c                              |  2 +-
 tests/general/draw-vertices-half-float.c                   |  2 +-
 tests/general/draw-vertices.c                              |  2 +-
 tests/general/framebuffer-srgb.c                           |  2 +-
 tests/general/stencil-drawpixels.c                         |  2 +-
 tests/general/triangle-rasterization-overdraw.cpp          |  2 +-
 tests/general/triangle-rasterization.cpp                   |  4 ++--
 tests/shaders/glsl-cos.c                                   |  2 +-
 tests/shaders/glsl-fs-discard-02.c                         |  2 +-
 tests/shaders/glsl-kwin-blur-1.c                           |  2 +-
 tests/shaders/glsl-kwin-blur-2.c                           |  2 +-
 tests/shaders/glsl-routing.c                               |  2 +-
 tests/shaders/glsl-sin.c                                   |  2 +-
 tests/spec/arb_draw_elements_base_vertex/negative-index.c  |  2 +-
 .../arb_es2_compatibility-drawbuffers.c                    |  4 ++--
 tests/spec/arb_framebuffer_srgb/srgb_conformance.c         |  4 ++--
 tests/spec/arb_map_buffer_range/invalidate.c               |  2 +-
 .../arb_map_buffer_range/map_buffer_range_error_check.c    |  2 +-
 tests/spec/arb_sampler_objects/framebufferblit.c           |  2 +-
 tests/spec/arb_shader_texture_lod/execution/texgrad.c      |  4 ++--
 tests/spec/arb_shader_texture_lod/execution/texgradcube.c  |  4 ++--
 tests/spec/arb_texture_cube_map_array/fbo-cubemap-array.c  |  6 +++---
 tests/spec/arb_transform_feedback2/draw-auto.c             |  6 +++---
 .../arb_vertex_type_2_10_10_10_rev/draw-vertices-2101010.c |  2 +-
 tests/spec/ati_draw_buffers/arbfp-no-index.c               |  2 +-
 tests/spec/ati_draw_buffers/arbfp-no-option.c              |  2 +-
 tests/spec/ati_draw_buffers/arbfp.c                        |  2 +-
 tests/spec/ext_packed_depth_stencil/readpixels-24_8.c      |  2 +-
 tests/spec/ext_transform_feedback/interleaved.c            |  6 +++---
 tests/spec/ext_transform_feedback/output-type.c            |  8 ++++----
 tests/spec/ext_transform_feedback/position.c               |  8 ++++----
 tests/spec/ext_transform_feedback/separate.c               |  6 +++---
 tests/texturing/tex-miplevel-selection.c                   | 10 +++++-----
 tests/texturing/texwrap.c                                  |  6 +++---
 89 files changed, 156 insertions(+), 156 deletions(-)

diff --git a/tests/bugs/fdo14575.c b/tests/bugs/fdo14575.c
index b2f780b..e855241 100644
--- a/tests/bugs/fdo14575.c
+++ b/tests/bugs/fdo14575.c
@@ -55,7 +55,7 @@ piglit_init(int argc, char**argv)
 	glBindBufferARB(GL_ARRAY_BUFFER_ARB, buf);
 	glBufferDataARB(GL_ARRAY_BUFFER_ARB, 4, &data, GL_STATIC_DRAW_ARB);
 	glDeleteBuffersARB(1, &buf);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	/* Then, another normal path: create, map, write, unmap, delete */
 	glBindBufferARB(GL_ARRAY_BUFFER_ARB, buf);
@@ -64,7 +64,7 @@ piglit_init(int argc, char**argv)
 	*v = data;
 	glUnmapBufferARB(GL_ARRAY_BUFFER_ARB);
 	glDeleteBuffersARB(1, &buf);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	/* Then, do the failing path: create, map, delete */
 	glBindBufferARB(GL_ARRAY_BUFFER_ARB, buf);
@@ -72,7 +72,7 @@ piglit_init(int argc, char**argv)
 	v = (GLfloat *) glMapBufferARB(GL_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB);
 	*v = data;
 	glDeleteBuffersARB(1, &buf);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	piglit_report_result(PIGLIT_PASS);
 }
diff --git a/tests/fbo/fbo-1d.c b/tests/fbo/fbo-1d.c
index 382febf..4915db6 100644
--- a/tests/fbo/fbo-1d.c
+++ b/tests/fbo/fbo-1d.c
@@ -56,7 +56,7 @@ create_1d_fbo(void)
 		     BUF_WIDTH,
 		     0,
 		     GL_RGBA, GL_UNSIGNED_BYTE, NULL);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	glGenFramebuffersEXT(1, &fb);
 	glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
@@ -67,7 +67,7 @@ create_1d_fbo(void)
 				  tex,
 				  0);
 
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
 	if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
diff --git a/tests/fbo/fbo-3d.c b/tests/fbo/fbo-3d.c
index 4848f2b..4e8f67a 100644
--- a/tests/fbo/fbo-3d.c
+++ b/tests/fbo/fbo-3d.c
@@ -76,7 +76,7 @@ create_3d_fbo(void)
 		     BUF_WIDTH, BUF_HEIGHT, pot_depth,
 		     0,
 		     GL_RGBA, GL_UNSIGNED_BYTE, NULL);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	glGenFramebuffersEXT(1, &fb);
 	glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
@@ -90,7 +90,7 @@ create_3d_fbo(void)
 					  0,
 					  depth);
 
-		assert(glGetError() == 0);
+		piglit_check_gl_error(0);
 
 		status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
 		if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
diff --git a/tests/fbo/fbo-alpha.c b/tests/fbo/fbo-alpha.c
index 48da04c..0f2ca10 100644
--- a/tests/fbo/fbo-alpha.c
+++ b/tests/fbo/fbo-alpha.c
@@ -73,7 +73,7 @@ piglit_display(void)
 				  GL_TEXTURE_2D,
 				  tex,
 				  0);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
 	if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
diff --git a/tests/fbo/fbo-alphatest-formats.c b/tests/fbo/fbo-alphatest-formats.c
index a51d66c..570468e 100644
--- a/tests/fbo/fbo-alphatest-formats.c
+++ b/tests/fbo/fbo-alphatest-formats.c
@@ -172,7 +172,7 @@ static enum piglit_result test_format(const struct format_desc *format)
 				  GL_TEXTURE_2D,
 				  tex,
 				  0);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
 	printf("Testing %s", format->name);
diff --git a/tests/fbo/fbo-alphatest-nocolor-ff.c b/tests/fbo/fbo-alphatest-nocolor-ff.c
index e04a626..da174b5 100644
--- a/tests/fbo/fbo-alphatest-nocolor-ff.c
+++ b/tests/fbo/fbo-alphatest-nocolor-ff.c
@@ -51,7 +51,7 @@ static void create_fbo(GLuint *out_tex)
 	glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT,
 		     BUF_WIDTH, BUF_WIDTH, 0,
 		     GL_DEPTH_COMPONENT, GL_FLOAT, NULL);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	/* Create the FBO. */
 	glGenFramebuffersEXT(1, &fb);
@@ -76,7 +76,7 @@ static void create_fbo(GLuint *out_tex)
 	glClearDepth(0.0);
 	glClear(GL_DEPTH_BUFFER_BIT);
 
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	glEnable(GL_ALPHA_TEST);
 	glAlphaFunc(GL_GREATER, 0.5f);
diff --git a/tests/fbo/fbo-alphatest-nocolor.c b/tests/fbo/fbo-alphatest-nocolor.c
index 0294a18..8b7760e 100644
--- a/tests/fbo/fbo-alphatest-nocolor.c
+++ b/tests/fbo/fbo-alphatest-nocolor.c
@@ -66,7 +66,7 @@ static void create_fbo(GLuint *out_tex)
 	glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT,
 		     BUF_WIDTH, BUF_WIDTH, 0,
 		     GL_DEPTH_COMPONENT, GL_FLOAT, NULL);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	/* Create the FBO. */
 	glGenFramebuffersEXT(1, &fb);
@@ -91,7 +91,7 @@ static void create_fbo(GLuint *out_tex)
 	glClearDepth(0.0);
 	glClear(GL_DEPTH_BUFFER_BIT);
 
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	glEnable(GL_ALPHA_TEST);
 	glAlphaFunc(GL_GREATER, 0.5f);
diff --git a/tests/fbo/fbo-array.c b/tests/fbo/fbo-array.c
index 6f1e877..1995ba8 100644
--- a/tests/fbo/fbo-array.c
+++ b/tests/fbo/fbo-array.c
@@ -93,14 +93,14 @@ create_array_fbo(void)
 
 	glGenTextures(1, &tex);
 	glBindTexture(GL_TEXTURE_2D_ARRAY_EXT, tex);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	/* allocate empty array texture */
 	glTexImage3D(GL_TEXTURE_2D_ARRAY_EXT, 0, GL_RGBA,
 		     BUF_WIDTH, BUF_HEIGHT, num_layers,
 		     0,
 		     GL_RGBA, GL_UNSIGNED_BYTE, NULL);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	glGenFramebuffersEXT(1, &fb);
 	glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
@@ -113,7 +113,7 @@ create_array_fbo(void)
 					     0,
 					     layer);
 
-		assert(glGetError() == 0);
+		piglit_check_gl_error(0);
 
 		status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
 		if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
diff --git a/tests/fbo/fbo-blending-formats.c b/tests/fbo/fbo-blending-formats.c
index 3e6acd2..35f4344 100644
--- a/tests/fbo/fbo-blending-formats.c
+++ b/tests/fbo/fbo-blending-formats.c
@@ -280,7 +280,7 @@ static enum piglit_result test_format(const struct format_desc *format)
 				  GL_TEXTURE_2D,
 				  tex,
 				  0);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
 	printf("Testing %s", format->name);
diff --git a/tests/fbo/fbo-blit-d24s8.c b/tests/fbo/fbo-blit-d24s8.c
index dcee918..69a4f60 100644
--- a/tests/fbo/fbo-blit-d24s8.c
+++ b/tests/fbo/fbo-blit-d24s8.c
@@ -81,7 +81,7 @@ make_fbo(int w, int h)
 
 	glDrawBuffer(GL_NONE);
 	glReadBuffer(GL_NONE);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
 	if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
@@ -229,7 +229,7 @@ run_test(void)
 	     GL_DEPTH_BUFFER_BIT);
 
 	glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	printf("Verify 1\n");
 	pass = verify_depth_rect(PAD, y0, SIZE, SIZE) && pass;
@@ -243,7 +243,7 @@ run_test(void)
 	printf("Verify 5 (FBO)\n");
 	pass = verify_depth_rect(PAD, y1, SIZE, SIZE) && pass;
 	glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	piglit_present_results();
 
diff --git a/tests/fbo/fbo-blit-stretch.cpp b/tests/fbo/fbo-blit-stretch.cpp
index 8235ec4..b7d1b74 100644
--- a/tests/fbo/fbo-blit-stretch.cpp
+++ b/tests/fbo/fbo-blit-stretch.cpp
@@ -353,7 +353,7 @@ run_test(const TestCase &test)
 			       GL_TEXTURE_2D,
 			       tex,
 			       0);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
 	if (status != GL_FRAMEBUFFER_COMPLETE) {
diff --git a/tests/fbo/fbo-blit.c b/tests/fbo/fbo-blit.c
index 79b3020..c349289 100644
--- a/tests/fbo/fbo-blit.c
+++ b/tests/fbo/fbo-blit.c
@@ -77,7 +77,7 @@ make_fbo(int w, int h)
 				  target,
 				  tex,
 				  0);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
 	if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
diff --git a/tests/fbo/fbo-clearmipmap.c b/tests/fbo/fbo-clearmipmap.c
index 7b066c0..54bb792 100644
--- a/tests/fbo/fbo-clearmipmap.c
+++ b/tests/fbo/fbo-clearmipmap.c
@@ -76,7 +76,7 @@ piglit_init(int argc, char **argv)
 			     0,
 			     GL_RGBA, GL_UNSIGNED_BYTE, NULL);
 	}
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	glBindTexture(GL_TEXTURE_2D, 0);
 	glDisable(GL_TEXTURE_2D);
@@ -104,7 +104,7 @@ piglit_init(int argc, char **argv)
 			     0.0);
 		glClear(GL_COLOR_BUFFER_BIT);
 
-		assert(glGetError() == 0);
+		piglit_check_gl_error(0);
 	}
 done:
 	glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
diff --git a/tests/fbo/fbo-colormask-formats.c b/tests/fbo/fbo-colormask-formats.c
index 2f23d4d..8324464 100644
--- a/tests/fbo/fbo-colormask-formats.c
+++ b/tests/fbo/fbo-colormask-formats.c
@@ -145,7 +145,7 @@ static enum piglit_result test_format(const struct format_desc *format)
 				  GL_TEXTURE_2D,
 				  tex,
 				  0);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
 	printf("Testing %s", format->name);
diff --git a/tests/fbo/fbo-copypix.c b/tests/fbo/fbo-copypix.c
index a3ae563..1eded2b 100644
--- a/tests/fbo/fbo-copypix.c
+++ b/tests/fbo/fbo-copypix.c
@@ -72,7 +72,7 @@ make_fbo(int w, int h)
 				  GL_TEXTURE_2D,
 				  tex,
 				  0);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
 	if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
diff --git a/tests/fbo/fbo-copyteximage-simple.c b/tests/fbo/fbo-copyteximage-simple.c
index 511b97b..49ce08a 100644
--- a/tests/fbo/fbo-copyteximage-simple.c
+++ b/tests/fbo/fbo-copyteximage-simple.c
@@ -67,7 +67,7 @@ create_fbo(void)
 		     0,
 		     GL_RGBA, GL_UNSIGNED_BYTE, NULL);
 
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	glGenFramebuffersEXT(1, &fb);
 	glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
@@ -76,7 +76,7 @@ create_fbo(void)
 				  GL_TEXTURE_2D,
 				  tex,
 				  0);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
 	if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
diff --git a/tests/fbo/fbo-copyteximage.c b/tests/fbo/fbo-copyteximage.c
index e0b47f7..29c598a 100644
--- a/tests/fbo/fbo-copyteximage.c
+++ b/tests/fbo/fbo-copyteximage.c
@@ -68,7 +68,7 @@ create_fbo(void)
 			     0,
 			     GL_RGBA, GL_UNSIGNED_BYTE, NULL);
 	}
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	/* Draw into the second level. */
 	glGenFramebuffersEXT(1, &fb);
@@ -78,7 +78,7 @@ create_fbo(void)
 				  GL_TEXTURE_2D,
 				  tex,
 				  1);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
 	if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
diff --git a/tests/fbo/fbo-cubemap.c b/tests/fbo/fbo-cubemap.c
index 2eb45af..59c48ce 100644
--- a/tests/fbo/fbo-cubemap.c
+++ b/tests/fbo/fbo-cubemap.c
@@ -82,7 +82,7 @@ create_cube_fbo(void)
 			level++;
 		}
 	}
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	glGenFramebuffersEXT(1, &fb);
 	glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
@@ -97,7 +97,7 @@ create_cube_fbo(void)
 						  tex,
 						  level);
 
-			assert(glGetError() == 0);
+			piglit_check_gl_error(0);
 
 			status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
 			if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
diff --git a/tests/fbo/fbo-depth-array.c b/tests/fbo/fbo-depth-array.c
index 84370e4..d586967 100644
--- a/tests/fbo/fbo-depth-array.c
+++ b/tests/fbo/fbo-depth-array.c
@@ -225,13 +225,13 @@ create_array_fbo(void)
 
 	glGenTextures(1, &tex);
 	glBindTexture(GL_TEXTURE_2D_ARRAY, tex);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	/* allocate empty array texture */
 	glTexImage3D(GL_TEXTURE_2D_ARRAY, 0, GL_DEPTH24_STENCIL8,
 		     width, height, layers, 0,
 		     GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, NULL);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	glGenFramebuffers(1, &fb);
 	glBindFramebuffer(GL_FRAMEBUFFER, fb);
@@ -271,7 +271,7 @@ create_array_fbo(void)
 					  0,
 					  layer);
 
-		assert(glGetError() == 0);
+		piglit_check_gl_error(0);
 
 		status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
 		if (status != GL_FRAMEBUFFER_COMPLETE) {
@@ -347,7 +347,7 @@ create_array_fbo(void)
 
 done:
 	glDeleteFramebuffers(1, &fb);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 	return tex;
 }
 
@@ -385,7 +385,7 @@ draw_layer(int x, int y, int depth)
 			     (double)height / piglit_height * 2,
 			     0, 0, 1, 1);
 	glUseProgram(0);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 }
 
 static GLboolean test_layer_drawing(int start_x, int start_y, float expected)
@@ -433,7 +433,7 @@ test_once(void)
 	}
 
 	glDeleteTextures(1, &tex);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 	return pass;
 }
 
@@ -506,5 +506,5 @@ void piglit_init(int argc, char **argv)
 
 	program_fs_empty = piglit_build_simple_program(vs_text,
 					frag_shader_empty_text);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 }
diff --git a/tests/fbo/fbo-depth-sample-compare.c b/tests/fbo/fbo-depth-sample-compare.c
index 72f7d00..098b950 100644
--- a/tests/fbo/fbo-depth-sample-compare.c
+++ b/tests/fbo/fbo-depth-sample-compare.c
@@ -83,7 +83,7 @@ create_fbo(void)
    glTexImage2D(TexTarget, 0, depthIntFormat,
                 SIZE, SIZE, 0,
                 GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL);
-   assert(glGetError() == 0);
+   piglit_check_gl_error(0);
    glGetTexLevelParameteriv(TexTarget, 0, GL_TEXTURE_DEPTH_SIZE, &Zbits);
 
    /* color texture */
@@ -94,7 +94,7 @@ create_fbo(void)
    glTexImage2D(TexTarget, 0, GL_RGBA,
                 SIZE, SIZE, 0,
                 GL_RGBA, GL_UNSIGNED_BYTE, NULL);
-   assert(glGetError() == 0);
+   piglit_check_gl_error(0);
 
    /* Create FBO */
    glGenFramebuffersEXT(1, &FBO);
@@ -112,7 +112,7 @@ create_fbo(void)
                              DepthTex,
                              0);
 
-   assert(glGetError() == 0);
+   piglit_check_gl_error(0);
 
    status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
    if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
@@ -315,7 +315,7 @@ show_depth_fbo(void)
 
    glWindowPos2i(SIZE, 0);
    glDrawPixels(SIZE, SIZE, GL_LUMINANCE, GL_FLOAT, zf);
-   assert(glGetError() == 0);
+   piglit_check_gl_error(0);
 
 #if DEBUG
    {
diff --git a/tests/fbo/fbo-depth-tex1d.c b/tests/fbo/fbo-depth-tex1d.c
index e4df8ec..6e62ad1 100644
--- a/tests/fbo/fbo-depth-tex1d.c
+++ b/tests/fbo/fbo-depth-tex1d.c
@@ -84,13 +84,13 @@ static void create_1d_fbo(GLuint *out_tex, GLuint *out_ds)
 		     BUF_WIDTH,
 		     0,
 		     GL_RGBA, GL_UNSIGNED_BYTE, NULL);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	/* Create the depth-stencil buffer. */
 	glGenTextures(1, &ds);
 	glBindTexture(GL_TEXTURE_1D, ds);
 	glTexImage1D(GL_TEXTURE_1D, 0, f.iformat, BUF_WIDTH, 0, f.format, f.type, NULL);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	/* Create the FBO. */
 	glGenFramebuffersEXT(1, &fb);
@@ -116,7 +116,7 @@ static void create_1d_fbo(GLuint *out_tex, GLuint *out_ds)
 					  0);
 	}
 
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
 	if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
diff --git a/tests/fbo/fbo-depth.c b/tests/fbo/fbo-depth.c
index 196c51f..7fdf6fa 100644
--- a/tests/fbo/fbo-depth.c
+++ b/tests/fbo/fbo-depth.c
@@ -311,7 +311,7 @@ enum piglit_result piglit_display(void)
 
 	piglit_present_results();
 
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 	return res;
 }
 
diff --git a/tests/fbo/fbo-depthstencil.c b/tests/fbo/fbo-depthstencil.c
index 43a3080..e277cb7 100644
--- a/tests/fbo/fbo-depthstencil.c
+++ b/tests/fbo/fbo-depthstencil.c
@@ -480,7 +480,7 @@ enum piglit_result piglit_display(void)
 
 	piglit_present_results();
 
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 	return res;
 }
 
diff --git a/tests/fbo/fbo-drawbuffers-arbfp.c b/tests/fbo/fbo-drawbuffers-arbfp.c
index e5b2117..db75b9f 100644
--- a/tests/fbo/fbo-drawbuffers-arbfp.c
+++ b/tests/fbo/fbo-drawbuffers-arbfp.c
@@ -69,7 +69,7 @@ attach_texture(int i)
 				  GL_TEXTURE_2D,
 				  tex,
 				  0);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	return tex;
 }
diff --git a/tests/fbo/fbo-drawbuffers-blend-add.c b/tests/fbo/fbo-drawbuffers-blend-add.c
index b045f23..ee86021 100644
--- a/tests/fbo/fbo-drawbuffers-blend-add.c
+++ b/tests/fbo/fbo-drawbuffers-blend-add.c
@@ -104,7 +104,7 @@ attach_texture(int i)
 				  GL_TEXTURE_2D,
 				  tex,
 				  0);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	return tex;
 }
diff --git a/tests/fbo/fbo-drawbuffers-fragcolor.c b/tests/fbo/fbo-drawbuffers-fragcolor.c
index 1e75ded..ef15074 100644
--- a/tests/fbo/fbo-drawbuffers-fragcolor.c
+++ b/tests/fbo/fbo-drawbuffers-fragcolor.c
@@ -77,7 +77,7 @@ attach_texture(int i)
 				  GL_TEXTURE_2D,
 				  tex,
 				  0);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	return tex;
 }
diff --git a/tests/fbo/fbo-drawbuffers-maxtargets.c b/tests/fbo/fbo-drawbuffers-maxtargets.c
index 795d039..2748dd4 100644
--- a/tests/fbo/fbo-drawbuffers-maxtargets.c
+++ b/tests/fbo/fbo-drawbuffers-maxtargets.c
@@ -105,7 +105,7 @@ attach_texture(int i)
 				  GL_TEXTURE_2D,
 				  tex,
 				  0);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	return tex;
 }
diff --git a/tests/fbo/fbo-drawbuffers.c b/tests/fbo/fbo-drawbuffers.c
index 4b72f27..3ee4a37 100644
--- a/tests/fbo/fbo-drawbuffers.c
+++ b/tests/fbo/fbo-drawbuffers.c
@@ -61,7 +61,7 @@ attach_texture(int i)
 				  GL_TEXTURE_2D,
 				  tex,
 				  0);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	return tex;
 }
diff --git a/tests/fbo/fbo-drawbuffers2-blend.c b/tests/fbo/fbo-drawbuffers2-blend.c
index 4702137..fb71d7b 100644
--- a/tests/fbo/fbo-drawbuffers2-blend.c
+++ b/tests/fbo/fbo-drawbuffers2-blend.c
@@ -60,7 +60,7 @@ attach_texture(int i)
 				  GL_TEXTURE_2D,
 				  tex,
 				  0);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	return tex;
 }
diff --git a/tests/fbo/fbo-drawbuffers2-colormask.c b/tests/fbo/fbo-drawbuffers2-colormask.c
index 84d1ac8..82640ce 100644
--- a/tests/fbo/fbo-drawbuffers2-colormask.c
+++ b/tests/fbo/fbo-drawbuffers2-colormask.c
@@ -62,7 +62,7 @@ attach_texture(int i)
 				  GL_TEXTURE_2D,
 				  tex,
 				  0);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	return tex;
 }
diff --git a/tests/fbo/fbo-finish-deleted.c b/tests/fbo/fbo-finish-deleted.c
index 4895657..e992160 100644
--- a/tests/fbo/fbo-finish-deleted.c
+++ b/tests/fbo/fbo-finish-deleted.c
@@ -72,7 +72,7 @@ void piglit_init(int argc, char **argv)
 				  GL_TEXTURE_2D,
 				  tex,
 				  0);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 	glDrawBuffer(GL_COLOR_ATTACHMENT0_EXT);
 
 	status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
diff --git a/tests/fbo/fbo-flushing-2.c b/tests/fbo/fbo-flushing-2.c
index 011b4d6..2f03bcc 100644
--- a/tests/fbo/fbo-flushing-2.c
+++ b/tests/fbo/fbo-flushing-2.c
@@ -78,7 +78,7 @@ piglit_display(void)
 				  GL_TEXTURE_2D,
 				  tex,
 				  0);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	assert(glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT) ==
 	       GL_FRAMEBUFFER_COMPLETE_EXT);
diff --git a/tests/fbo/fbo-flushing.c b/tests/fbo/fbo-flushing.c
index 8bb1290..b681965 100644
--- a/tests/fbo/fbo-flushing.c
+++ b/tests/fbo/fbo-flushing.c
@@ -78,7 +78,7 @@ piglit_display(void)
 				  GL_TEXTURE_2D,
 				  tex,
 				  0);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	assert(glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT) ==
 	       GL_FRAMEBUFFER_COMPLETE_EXT);
diff --git a/tests/fbo/fbo-fragcoord.c b/tests/fbo/fbo-fragcoord.c
index e18e24d..c9915ca 100644
--- a/tests/fbo/fbo-fragcoord.c
+++ b/tests/fbo/fbo-fragcoord.c
@@ -57,13 +57,13 @@ create_fbo(unsigned width, unsigned height, GLuint *out_tex)
 		     0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
 	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
 	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	glGenFramebuffersEXT(1, &fb);
 	glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
 	glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
 				  GL_TEXTURE_2D, tex, 0);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
 	if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
@@ -121,7 +121,7 @@ piglit_display(void)
 	glDeleteTextures(1, &tex);
 	glDeleteFramebuffersEXT(1, &fb);
 
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	for (y = 0; y < piglit_height; y++) {
 		for (x = 0; x < piglit_width; x++) {
diff --git a/tests/fbo/fbo-generatemipmap-array.c b/tests/fbo/fbo-generatemipmap-array.c
index be3c498..7568344 100644
--- a/tests/fbo/fbo-generatemipmap-array.c
+++ b/tests/fbo/fbo-generatemipmap-array.c
@@ -135,14 +135,14 @@ create_array_fbo_1d(void)
 
 	glGenTextures(1, &tex);
 	glBindTexture(GL_TEXTURE_1D_ARRAY_EXT, tex);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	for (i = 0, dim = TEX_WIDTH; dim >0; i++, dim /= 2) {
 		glTexImage2D(GL_TEXTURE_1D_ARRAY_EXT, i, format,
 			     dim, num_layers, 0,
 			     GL_RGBA, GL_UNSIGNED_BYTE, NULL);
 	}
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	glGenFramebuffersEXT(1, &fb);
 	glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
@@ -153,7 +153,7 @@ create_array_fbo_1d(void)
 					  tex,
 					  0,
 					  layer);
-		assert(glGetError() == 0);
+		piglit_check_gl_error(0);
 
 		status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
 		if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
@@ -222,14 +222,14 @@ create_array_fbo_2d(void)
 
 	glGenTextures(1, &tex);
 	glBindTexture(GL_TEXTURE_2D_ARRAY_EXT, tex);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	for (i = 0, dim = TEX_WIDTH; dim >0; i++, dim /= 2) {
 		glTexImage3D(GL_TEXTURE_2D_ARRAY_EXT, i, format,
 			     dim, dim, num_layers, 0,
 			     GL_RGBA, GL_UNSIGNED_BYTE, NULL);
 	}
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	glGenFramebuffersEXT(1, &fb);
 	glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
@@ -240,7 +240,7 @@ create_array_fbo_2d(void)
 					  tex,
 					  0,
 					  layer);
-		assert(glGetError() == 0);
+		piglit_check_gl_error(0);
 
 		status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
 		if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
diff --git a/tests/fbo/fbo-generatemipmap-formats.c b/tests/fbo/fbo-generatemipmap-formats.c
index 9cb7d4e..17ffc10 100644
--- a/tests/fbo/fbo-generatemipmap-formats.c
+++ b/tests/fbo/fbo-generatemipmap-formats.c
@@ -82,7 +82,7 @@ create_tex(GLenum internalformat, GLenum baseformat, GLenum basetype)
 	if ((baseformat == GL_DEPTH_COMPONENT) || (baseformat == GL_DEPTH_STENCIL)) {
 		tex = piglit_depth_texture(GL_TEXTURE_2D, internalformat,
 					   tex_width, tex_height, 1, GL_FALSE);
-		assert(glGetError() == 0);
+		piglit_check_gl_error(0);
 		if (internalformat == GL_DEPTH32F_STENCIL8) {
 			format = GL_DEPTH_STENCIL;
 			type = GL_FLOAT_32_UNSIGNED_INT_24_8_REV;
@@ -117,7 +117,7 @@ create_tex(GLenum internalformat, GLenum baseformat, GLenum basetype)
 			     0,
 			     format, type, NULL);
 	}
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	glGenerateMipmapEXT(GL_TEXTURE_2D);
 
@@ -226,7 +226,7 @@ draw_mipmap(int x, int y, int level, GLenum basetype)
 				    b||l||i||d ? 0.5 : 1,
 				    a||i       ? 0.5 : 1);
 		}
-		assert(glGetError() == 0);
+		piglit_check_gl_error(0);
 		break;
 
 	default:
diff --git a/tests/fbo/fbo-generatemipmap-nonsquare.c b/tests/fbo/fbo-generatemipmap-nonsquare.c
index 7a1ec19..a61eb21 100644
--- a/tests/fbo/fbo-generatemipmap-nonsquare.c
+++ b/tests/fbo/fbo-generatemipmap-nonsquare.c
@@ -72,7 +72,7 @@ create_fbo(void)
 			     0,
 			     GL_RGBA, GL_UNSIGNED_BYTE, NULL);
 	}
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	glGenFramebuffersEXT(1, &fb);
 	glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
@@ -81,7 +81,7 @@ create_fbo(void)
 				  GL_TEXTURE_2D,
 				  tex,
 				  0);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
 	if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
diff --git a/tests/fbo/fbo-generatemipmap-npot.c b/tests/fbo/fbo-generatemipmap-npot.c
index 6ea8746..e798a41 100644
--- a/tests/fbo/fbo-generatemipmap-npot.c
+++ b/tests/fbo/fbo-generatemipmap-npot.c
@@ -66,7 +66,7 @@ create_fbo(void)
 			     0,
 			     GL_RGBA, GL_UNSIGNED_BYTE, NULL);
 	}
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	glGenFramebuffersEXT(1, &fb);
 	glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
@@ -75,7 +75,7 @@ create_fbo(void)
 				  GL_TEXTURE_2D,
 				  tex,
 				  0);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
 	if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
diff --git a/tests/fbo/fbo-generatemipmap-scissor.c b/tests/fbo/fbo-generatemipmap-scissor.c
index d08850a..d01aa2b 100644
--- a/tests/fbo/fbo-generatemipmap-scissor.c
+++ b/tests/fbo/fbo-generatemipmap-scissor.c
@@ -69,7 +69,7 @@ create_fbo(void)
 			     0,
 			     GL_RGBA, GL_UNSIGNED_BYTE, NULL);
 	}
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	glGenFramebuffersEXT(1, &fb);
 	glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
@@ -78,7 +78,7 @@ create_fbo(void)
 				  GL_TEXTURE_2D,
 				  tex,
 				  0);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
 	if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
diff --git a/tests/fbo/fbo-generatemipmap-swizzle.c b/tests/fbo/fbo-generatemipmap-swizzle.c
index 4b80df4..04e5555 100644
--- a/tests/fbo/fbo-generatemipmap-swizzle.c
+++ b/tests/fbo/fbo-generatemipmap-swizzle.c
@@ -71,7 +71,7 @@ create_fbo(void)
 			     0,
 			     GL_RED, GL_UNSIGNED_BYTE, NULL);
 	}
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	glGenFramebuffersEXT(1, &fb);
 	glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
@@ -80,7 +80,7 @@ create_fbo(void)
 				  GL_TEXTURE_2D,
 				  tex,
 				  0);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
 	if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
diff --git a/tests/fbo/fbo-generatemipmap-viewport.c b/tests/fbo/fbo-generatemipmap-viewport.c
index 4e94d56..0becf0e 100644
--- a/tests/fbo/fbo-generatemipmap-viewport.c
+++ b/tests/fbo/fbo-generatemipmap-viewport.c
@@ -68,7 +68,7 @@ create_fbo(void)
 			     0,
 			     GL_RGBA, GL_UNSIGNED_BYTE, NULL);
 	}
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	glGenFramebuffersEXT(1, &fb);
 	glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
@@ -77,7 +77,7 @@ create_fbo(void)
 				  GL_TEXTURE_2D,
 				  tex,
 				  0);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
 	if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
diff --git a/tests/fbo/fbo-generatemipmap.c b/tests/fbo/fbo-generatemipmap.c
index 656b0d4..551c144 100644
--- a/tests/fbo/fbo-generatemipmap.c
+++ b/tests/fbo/fbo-generatemipmap.c
@@ -66,7 +66,7 @@ create_fbo(void)
 			     0,
 			     GL_RGBA, GL_UNSIGNED_BYTE, NULL);
 	}
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	glGenFramebuffersEXT(1, &fb);
 	glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
@@ -75,7 +75,7 @@ create_fbo(void)
 				  GL_TEXTURE_2D,
 				  tex,
 				  0);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
 	if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
diff --git a/tests/fbo/fbo-luminance-alpha.c b/tests/fbo/fbo-luminance-alpha.c
index 8ece653..489ca57 100644
--- a/tests/fbo/fbo-luminance-alpha.c
+++ b/tests/fbo/fbo-luminance-alpha.c
@@ -77,7 +77,7 @@ piglit_display(void)
 				  GL_TEXTURE_2D,
 				  tex,
 				  0);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
 	if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
diff --git a/tests/fbo/fbo-maxsize.c b/tests/fbo/fbo-maxsize.c
index 02ce094..fd9e684 100644
--- a/tests/fbo/fbo-maxsize.c
+++ b/tests/fbo/fbo-maxsize.c
@@ -130,7 +130,7 @@ static int create_fbo(void)
 				  GL_COLOR_ATTACHMENT0_EXT,
 				  GL_TEXTURE_2D,
 				  tex, 0);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
 	if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
diff --git a/tests/fbo/fbo-nodepth-test.c b/tests/fbo/fbo-nodepth-test.c
index 9e86b17..6cfc9bc 100644
--- a/tests/fbo/fbo-nodepth-test.c
+++ b/tests/fbo/fbo-nodepth-test.c
@@ -65,7 +65,7 @@ piglit_display(void)
 				  GL_TEXTURE_2D,
 				  tex,
 				  0);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
 	if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
diff --git a/tests/fbo/fbo-nostencil-test.c b/tests/fbo/fbo-nostencil-test.c
index 0ca76ba..63eee4e 100644
--- a/tests/fbo/fbo-nostencil-test.c
+++ b/tests/fbo/fbo-nostencil-test.c
@@ -65,7 +65,7 @@ piglit_display(void)
 				  GL_TEXTURE_2D,
 				  tex,
 				  0);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
 	if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
diff --git a/tests/fbo/fbo-pbo-readpixels-small.c b/tests/fbo/fbo-pbo-readpixels-small.c
index 919c9fe..c089faf 100644
--- a/tests/fbo/fbo-pbo-readpixels-small.c
+++ b/tests/fbo/fbo-pbo-readpixels-small.c
@@ -68,7 +68,7 @@ make_fbo(GLuint *fbo, GLuint *tex)
 				  GL_TEXTURE_2D,
 				  *tex,
 				  0);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
 	if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
diff --git a/tests/fbo/fbo-readdrawpix.c b/tests/fbo/fbo-readdrawpix.c
index 7d2e8f8..00e9584 100644
--- a/tests/fbo/fbo-readdrawpix.c
+++ b/tests/fbo/fbo-readdrawpix.c
@@ -72,7 +72,7 @@ make_fbo(int w, int h)
 				  GL_TEXTURE_2D,
 				  tex,
 				  0);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
 	if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
diff --git a/tests/fbo/fbo-readpixels-depth-formats.c b/tests/fbo/fbo-readpixels-depth-formats.c
index 8b3fdac..123c135 100644
--- a/tests/fbo/fbo-readpixels-depth-formats.c
+++ b/tests/fbo/fbo-readpixels-depth-formats.c
@@ -185,7 +185,7 @@ test_with_format(GLenum internal_format, const char *name)
 
 	glGenFramebuffersEXT(1, &fb);
 	glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	glGenRenderbuffersEXT(1, &rb);
 	glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, rb);
diff --git a/tests/fbo/fbo-readpixels.c b/tests/fbo/fbo-readpixels.c
index d70fed0..a51596d 100644
--- a/tests/fbo/fbo-readpixels.c
+++ b/tests/fbo/fbo-readpixels.c
@@ -87,7 +87,7 @@ test_with_format(GLenum internal_format, GLenum format,
 				  GL_TEXTURE_2D,
 				  tex,
 				  0);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
 	if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
diff --git a/tests/fbo/fbo-rg.c b/tests/fbo/fbo-rg.c
index 58a2de0..9e4a505 100644
--- a/tests/fbo/fbo-rg.c
+++ b/tests/fbo/fbo-rg.c
@@ -108,13 +108,13 @@ create_fbo(unsigned width, unsigned height, GLenum internal_format)
 		     0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
 	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
 	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	glGenFramebuffersEXT(1, &fb);
 	glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
 	glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
 				  GL_TEXTURE_2D, tex, 0);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
 	if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
diff --git a/tests/fbo/fbo-srgb.c b/tests/fbo/fbo-srgb.c
index a379d9d..8d1e365 100644
--- a/tests/fbo/fbo-srgb.c
+++ b/tests/fbo/fbo-srgb.c
@@ -72,7 +72,7 @@ make_fbo(int w, int h, int srgb_format, GLuint *tex_p)
 				  GL_TEXTURE_2D,
 				  tex,
 				  0);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
 	if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
@@ -123,7 +123,7 @@ framebuffer_srgb_fbo(int srgb_format)
 	fbo = make_fbo(fbo_width, fbo_height, srgb_format, &tex);
 	glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbo);
 
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	glViewport(0, 0, fbo_width, fbo_height);
 	piglit_ortho_projection(fbo_width, fbo_height, GL_FALSE);
diff --git a/tests/fbo/fbo-stencil.c b/tests/fbo/fbo-stencil.c
index 050d761..c4f733e 100644
--- a/tests/fbo/fbo-stencil.c
+++ b/tests/fbo/fbo-stencil.c
@@ -327,7 +327,7 @@ enum piglit_result piglit_display(void)
 
 	piglit_present_results();
 
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 	return res;
 }
 
diff --git a/tests/fbo/fbo-viewport.c b/tests/fbo/fbo-viewport.c
index d685f36..3bde16f 100644
--- a/tests/fbo/fbo-viewport.c
+++ b/tests/fbo/fbo-viewport.c
@@ -127,7 +127,7 @@ piglit_display(void)
 	glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
 				  GL_RENDERBUFFER, rb);
 
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	assert(glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT) ==
 			 GL_FRAMEBUFFER_COMPLETE_EXT);
diff --git a/tests/general/attribs.c b/tests/general/attribs.c
index f48d8b9..c6380e1 100644
--- a/tests/general/attribs.c
+++ b/tests/general/attribs.c
@@ -528,7 +528,7 @@ enum piglit_result piglit_display(void)
 		}
 	}
 
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 	piglit_present_results();
 
 	return pass ? PIGLIT_PASS : PIGLIT_FAIL;
diff --git a/tests/general/draw-elements.c b/tests/general/draw-elements.c
index 0f712c7..4ea31fc 100644
--- a/tests/general/draw-elements.c
+++ b/tests/general/draw-elements.c
@@ -244,7 +244,7 @@ enum piglit_result
 
 		printf("%s\n", tests[i].name);
 		tests[i].test(x, y, x+20, y+20, tests[i].index);
-		assert(glGetError() == 0);
+		piglit_check_gl_error(0);
 		pass = piglit_probe_pixel_rgb(x+5, y+5, tests[i].expected_color) && pass;
 
 		x += 20;
diff --git a/tests/general/draw-vertices-half-float.c b/tests/general/draw-vertices-half-float.c
index 37f1dc5..fb44c10 100644
--- a/tests/general/draw-vertices-half-float.c
+++ b/tests/general/draw-vertices-half-float.c
@@ -196,7 +196,7 @@ piglit_display(void)
 
         printf("%s\n", tests[i].name);
         tests[i].test(x, y, x+20, y+20, tests[i].index);
-        assert(glGetError() == 0);
+        piglit_check_gl_error(0);
         pass = piglit_probe_pixel_rgb(x+5, y+5, tests[i].expected_color) && pass;
 
         x += 20;
diff --git a/tests/general/draw-vertices.c b/tests/general/draw-vertices.c
index cd48816..81c5e31 100644
--- a/tests/general/draw-vertices.c
+++ b/tests/general/draw-vertices.c
@@ -565,7 +565,7 @@ piglit_display(void)
 
         printf("%s\n", tests[i].name);
         tests[i].test(x, y, x+20, y+20, tests[i].index);
-        assert(glGetError() == 0);
+        piglit_check_gl_error(0);
         pass = piglit_probe_pixel_rgb(x+5, y+5, tests[i].expected_color) && pass;
 
         x += 20;
diff --git a/tests/general/framebuffer-srgb.c b/tests/general/framebuffer-srgb.c
index acae0f0..1a34e0a 100644
--- a/tests/general/framebuffer-srgb.c
+++ b/tests/general/framebuffer-srgb.c
@@ -244,7 +244,7 @@ make_fbo(int w, int h)
 				  GL_TEXTURE_2D,
 				  tex,
 				  0);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
 	if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
diff --git a/tests/general/stencil-drawpixels.c b/tests/general/stencil-drawpixels.c
index e04ec9e..6da5a48 100644
--- a/tests/general/stencil-drawpixels.c
+++ b/tests/general/stencil-drawpixels.c
@@ -91,7 +91,7 @@ piglit_display(void)
 	glColor4fv(blue);
 	piglit_draw_rect(0, 0, piglit_width, piglit_height);
 
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	pass &= piglit_probe_rect_rgb(0, 0, piglit_width, 10, red);
 
diff --git a/tests/general/triangle-rasterization-overdraw.cpp b/tests/general/triangle-rasterization-overdraw.cpp
index 3930303..6454d1b 100644
--- a/tests/general/triangle-rasterization-overdraw.cpp
+++ b/tests/general/triangle-rasterization-overdraw.cpp
@@ -281,7 +281,7 @@ piglit_display(void)
 		piglit_present_results();
 	}
 
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 	return pass ? PIGLIT_PASS : PIGLIT_FAIL;
 }
 
diff --git a/tests/general/triangle-rasterization.cpp b/tests/general/triangle-rasterization.cpp
index 0d99ef1..9786fe4 100644
--- a/tests/general/triangle-rasterization.cpp
+++ b/tests/general/triangle-rasterization.cpp
@@ -541,7 +541,7 @@ piglit_display(void)
 					  tex,
 					  0);
 
-		assert(glGetError() == 0);
+		piglit_check_gl_error(0);
 		assert(glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT) == GL_FRAMEBUFFER_COMPLETE_EXT);
 
 		glBindTexture(GL_TEXTURE_2D, 0);
@@ -621,7 +621,7 @@ piglit_display(void)
 		glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
 	}
 
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	return pass ? PIGLIT_PASS : PIGLIT_FAIL;
 }
diff --git a/tests/shaders/glsl-cos.c b/tests/shaders/glsl-cos.c
index aebc7a4..61e93c7 100644
--- a/tests/shaders/glsl-cos.c
+++ b/tests/shaders/glsl-cos.c
@@ -86,7 +86,7 @@ static GLboolean test()
         glUniform1f(location, (i - 25) * DEGREES_30);
         piglit_draw_rect((i % 10) * 10, (i / 10) * 10, 10, 10);
     }
-    assert(glGetError() == 0);
+    piglit_check_gl_error(0);
 
     for (i = 0; i <= 50; i++) {
         color[0] = color[1] = cos((i - 25) * DEGREES_30) * 0.5 + 0.5;
diff --git a/tests/shaders/glsl-fs-discard-02.c b/tests/shaders/glsl-fs-discard-02.c
index 2401af5..b852504 100644
--- a/tests/shaders/glsl-fs-discard-02.c
+++ b/tests/shaders/glsl-fs-discard-02.c
@@ -95,7 +95,7 @@ static GLboolean test()
 	piglit_draw_rect_z(0.0, -1, -1, 2, 2); // discard
 	piglit_draw_rect_z(0.5, -1, -1, 2, 2); // green
 
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	pass = pass && piglit_probe_rect_rgba(0, 0, piglit_width, piglit_height, green);
 
diff --git a/tests/shaders/glsl-kwin-blur-1.c b/tests/shaders/glsl-kwin-blur-1.c
index dd0fb0d..e7a9bd5 100644
--- a/tests/shaders/glsl-kwin-blur-1.c
+++ b/tests/shaders/glsl-kwin-blur-1.c
@@ -195,7 +195,7 @@ static GLboolean test()
     glDisableClientState(GL_VERTEX_ARRAY);
     glDisableClientState(GL_TEXTURE_COORD_ARRAY);
 
-    assert(glGetError() == 0);
+    piglit_check_gl_error(0);
 
     /* Test the sides */
     for (i = 0; i < 14; i++) {
diff --git a/tests/shaders/glsl-kwin-blur-2.c b/tests/shaders/glsl-kwin-blur-2.c
index 0c03ff8..41125de 100644
--- a/tests/shaders/glsl-kwin-blur-2.c
+++ b/tests/shaders/glsl-kwin-blur-2.c
@@ -224,7 +224,7 @@ static GLboolean test()
     glDisableClientState(GL_VERTEX_ARRAY);
     glDisableClientState(GL_TEXTURE_COORD_ARRAY);
 
-    assert(glGetError() == 0);
+    piglit_check_gl_error(0);
 
     /* Test the sides */
     for (i = 0; i < 26; i++) {
diff --git a/tests/shaders/glsl-routing.c b/tests/shaders/glsl-routing.c
index 6bbc439..97d4bb1 100644
--- a/tests/shaders/glsl-routing.c
+++ b/tests/shaders/glsl-routing.c
@@ -211,7 +211,7 @@ static GLboolean test(unsigned vsbitmask, unsigned fsbitmask, int line)
             draw_rect(5 + (i*(BOX_SIZE+5)) % 240, 5 + height, i, attrib);
         }
     }
-    assert(glGetError() == 0);
+    piglit_check_gl_error(0);
 
     for (i = 0; i < ATTRIBS; i++) {
         if (((1 << i) & vsbitmask) && ((1 << i) & fsbitmask)) {
diff --git a/tests/shaders/glsl-sin.c b/tests/shaders/glsl-sin.c
index 192b4e2..6c70a29 100644
--- a/tests/shaders/glsl-sin.c
+++ b/tests/shaders/glsl-sin.c
@@ -86,7 +86,7 @@ static GLboolean test()
         glUniform1f(location, (i - 25) * DEGREES_30);
         piglit_draw_rect((i % 10) * 10, (i / 10) * 10, 10, 10);
     }
-    assert(glGetError() == 0);
+    piglit_check_gl_error(0);
 
     for (i = 0; i <= 50; i++) {
         color[0] = color[1] = sin((i - 25) * DEGREES_30) * 0.5 + 0.5;
diff --git a/tests/spec/arb_draw_elements_base_vertex/negative-index.c b/tests/spec/arb_draw_elements_base_vertex/negative-index.c
index e0667d3..9e312a1 100644
--- a/tests/spec/arb_draw_elements_base_vertex/negative-index.c
+++ b/tests/spec/arb_draw_elements_base_vertex/negative-index.c
@@ -124,7 +124,7 @@ enum piglit_result piglit_display(void)
 
 		printf("BaseVertex = -%i\n", index);
 		test_negative_index_offset(x, y, x+20, y+20, index);
-		assert(glGetError() == 0);
+		piglit_check_gl_error(0);
 		pass = piglit_probe_pixel_rgb(x+5, y+5, expected) && pass;
 
 		x += 20;
diff --git a/tests/spec/arb_es2_compatibility/arb_es2_compatibility-drawbuffers.c b/tests/spec/arb_es2_compatibility/arb_es2_compatibility-drawbuffers.c
index 0413534..8f18668 100644
--- a/tests/spec/arb_es2_compatibility/arb_es2_compatibility-drawbuffers.c
+++ b/tests/spec/arb_es2_compatibility/arb_es2_compatibility-drawbuffers.c
@@ -59,7 +59,7 @@ attach_texture(int i)
 				  GL_TEXTURE_2D,
 				  tex,
 				  0);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	return tex;
 }
@@ -106,7 +106,7 @@ piglit_init(int argc, char **argv)
 		piglit_report_result(PIGLIT_FAIL);
 	}
 
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	glDeleteTextures(1, &tex0);
 
diff --git a/tests/spec/arb_framebuffer_srgb/srgb_conformance.c b/tests/spec/arb_framebuffer_srgb/srgb_conformance.c
index 94df797..5f30817 100644
--- a/tests/spec/arb_framebuffer_srgb/srgb_conformance.c
+++ b/tests/spec/arb_framebuffer_srgb/srgb_conformance.c
@@ -94,7 +94,7 @@ static enum piglit_result test_format(void)
 				  GL_TEXTURE_2D,
 				  texfb,
 				  0);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
 	printf("Testing using fb float format");
@@ -162,7 +162,7 @@ static enum piglit_result test_format(void)
 				  texfb,
 				  0);
 
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	glEnable(GL_FRAMEBUFFER_SRGB_EXT);
 	status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
diff --git a/tests/spec/arb_map_buffer_range/invalidate.c b/tests/spec/arb_map_buffer_range/invalidate.c
index 8fb3996..0766073 100644
--- a/tests/spec/arb_map_buffer_range/invalidate.c
+++ b/tests/spec/arb_map_buffer_range/invalidate.c
@@ -236,7 +236,7 @@ enum piglit_result piglit_display(void)
 	}
 
 	glDeleteBuffers(1, &vbo);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 	piglit_present_results();
 
 	return pass ? PIGLIT_PASS : PIGLIT_FAIL;
diff --git a/tests/spec/arb_map_buffer_range/map_buffer_range_error_check.c b/tests/spec/arb_map_buffer_range/map_buffer_range_error_check.c
index fabc203..97eb26b 100644
--- a/tests/spec/arb_map_buffer_range/map_buffer_range_error_check.c
+++ b/tests/spec/arb_map_buffer_range/map_buffer_range_error_check.c
@@ -104,7 +104,7 @@ piglit_init(int argc, char *argv[])
 	 *   (d) GL_MAP_FLUSH_EXPLICIT_BIT is set and GL_MAP_WRITE_BIT is not set.
 	 */
 	glMapBufferRange(target, 0, 10, access);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	/* (a) map again */
 	glMapBufferRange(target, 0, 10, access);
diff --git a/tests/spec/arb_sampler_objects/framebufferblit.c b/tests/spec/arb_sampler_objects/framebufferblit.c
index 10e3625..c4b334f 100644
--- a/tests/spec/arb_sampler_objects/framebufferblit.c
+++ b/tests/spec/arb_sampler_objects/framebufferblit.c
@@ -71,7 +71,7 @@ piglit_display(void)
 				  GL_TEXTURE_2D,
 				  tex,
 				  0);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	glGenSamplers(1, &sampler);
 	glSamplerParameteri(sampler, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
diff --git a/tests/spec/arb_shader_texture_lod/execution/texgrad.c b/tests/spec/arb_shader_texture_lod/execution/texgrad.c
index ec09eda..31c2078 100644
--- a/tests/spec/arb_shader_texture_lod/execution/texgrad.c
+++ b/tests/spec/arb_shader_texture_lod/execution/texgrad.c
@@ -99,7 +99,7 @@ void piglit_init(int argc, char **argv)
 			     0,
 			     GL_RGBA, GL_UNSIGNED_BYTE, NULL);
 	}
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	glBindTexture(GL_TEXTURE_2D, 0);
 	glDisable(GL_TEXTURE_2D);
@@ -126,7 +126,7 @@ void piglit_init(int argc, char **argv)
 			     0.0);
 		glClear(GL_COLOR_BUFFER_BIT);
 
-		assert(glGetError() == 0);
+		piglit_check_gl_error(0);
 	}
 	glDeleteFramebuffersEXT(1, &fb);
 	glBindTexture(GL_TEXTURE_2D, tex);
diff --git a/tests/spec/arb_shader_texture_lod/execution/texgradcube.c b/tests/spec/arb_shader_texture_lod/execution/texgradcube.c
index aeaab48..97a6d88 100644
--- a/tests/spec/arb_shader_texture_lod/execution/texgradcube.c
+++ b/tests/spec/arb_shader_texture_lod/execution/texgradcube.c
@@ -100,7 +100,7 @@ void piglit_init(int argc, char **argv)
 				     GL_RGBA, GL_UNSIGNED_BYTE, NULL);
 		}
 	}
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	glBindTexture(GL_TEXTURE_CUBE_MAP, 0);
 	glDisable(GL_TEXTURE_CUBE_MAP);
@@ -128,7 +128,7 @@ void piglit_init(int argc, char **argv)
 				     0.0);
 			glClear(GL_COLOR_BUFFER_BIT);
 
-			assert(glGetError() == 0);
+			piglit_check_gl_error(0);
 		}
 	}
 
diff --git a/tests/spec/arb_texture_cube_map_array/fbo-cubemap-array.c b/tests/spec/arb_texture_cube_map_array/fbo-cubemap-array.c
index 980eadf..138a346 100644
--- a/tests/spec/arb_texture_cube_map_array/fbo-cubemap-array.c
+++ b/tests/spec/arb_texture_cube_map_array/fbo-cubemap-array.c
@@ -99,14 +99,14 @@ create_array_fbo(void)
 
 	glGenTextures(1, &tex);
 	glBindTexture(GL_TEXTURE_CUBE_MAP_ARRAY_ARB, tex);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	/* allocate empty array texture */
 	glTexImage3D(GL_TEXTURE_CUBE_MAP_ARRAY_ARB, 0, GL_RGBA,
 		     BUF_WIDTH, BUF_HEIGHT, num_layers,
 		     0,
 		     GL_RGBA, GL_UNSIGNED_BYTE, NULL);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	glGenFramebuffersEXT(1, &fb);
 	glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
@@ -119,7 +119,7 @@ create_array_fbo(void)
 					     0,
 					     layer);
 
-		assert(glGetError() == 0);
+		piglit_check_gl_error(0);
 
 		status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
 		if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
diff --git a/tests/spec/arb_transform_feedback2/draw-auto.c b/tests/spec/arb_transform_feedback2/draw-auto.c
index 801abde..c7cf843 100644
--- a/tests/spec/arb_transform_feedback2/draw-auto.c
+++ b/tests/spec/arb_transform_feedback2/draw-auto.c
@@ -119,7 +119,7 @@ void piglit_init(int argc, char **argv)
 	glBindBufferBaseEXT(GL_TRANSFORM_FEEDBACK_BUFFER_EXT, 0, buf);
 	glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, 0);
 
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	glClearColor(0.2, 0.2, 0.2, 1.0);
 	glEnableClientState(GL_VERTEX_ARRAY);
@@ -166,7 +166,7 @@ enum piglit_result piglit_display(void)
 	glEndTransformFeedbackEXT();
 	glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, 0);
 
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	glUseProgram(instanced ? prog_notransform_instanced : prog_notransform);
 	glBindBuffer(GL_ARRAY_BUFFER, buf);
@@ -181,7 +181,7 @@ enum piglit_result piglit_display(void)
 	glDisableClientState(GL_COLOR_ARRAY);
 	glBindBuffer(GL_ARRAY_BUFFER, 0);
 
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	pass = piglit_probe_pixel_rgb(15, 15, red) && pass;
 	pass = piglit_probe_pixel_rgb(35, 15, green) && pass;
diff --git a/tests/spec/arb_vertex_type_2_10_10_10_rev/draw-vertices-2101010.c b/tests/spec/arb_vertex_type_2_10_10_10_rev/draw-vertices-2101010.c
index 2c47372..8c021cb 100644
--- a/tests/spec/arb_vertex_type_2_10_10_10_rev/draw-vertices-2101010.c
+++ b/tests/spec/arb_vertex_type_2_10_10_10_rev/draw-vertices-2101010.c
@@ -226,7 +226,7 @@ piglit_display(void)
 
         printf("%s\n", tests[i].name);
         tests[i].test(x, y, x+20, y+20, tests[i].index);
-        assert(glGetError() == 0);
+        piglit_check_gl_error(0);
         pass = piglit_probe_pixel_rgba(x+5, y+5, tests[i].expected_color) && pass;
 
         x += 20;
diff --git a/tests/spec/ati_draw_buffers/arbfp-no-index.c b/tests/spec/ati_draw_buffers/arbfp-no-index.c
index 4ca7331..f386f14 100644
--- a/tests/spec/ati_draw_buffers/arbfp-no-index.c
+++ b/tests/spec/ati_draw_buffers/arbfp-no-index.c
@@ -77,7 +77,7 @@ attach_texture(int i)
 				  GL_TEXTURE_2D,
 				  tex,
 				  0);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	return tex;
 }
diff --git a/tests/spec/ati_draw_buffers/arbfp-no-option.c b/tests/spec/ati_draw_buffers/arbfp-no-option.c
index b5202ae..f9219b5 100644
--- a/tests/spec/ati_draw_buffers/arbfp-no-option.c
+++ b/tests/spec/ati_draw_buffers/arbfp-no-option.c
@@ -71,7 +71,7 @@ attach_texture(int i)
 				  GL_TEXTURE_2D,
 				  tex,
 				  0);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	return tex;
 }
diff --git a/tests/spec/ati_draw_buffers/arbfp.c b/tests/spec/ati_draw_buffers/arbfp.c
index 7b25b14..c7c91a4 100644
--- a/tests/spec/ati_draw_buffers/arbfp.c
+++ b/tests/spec/ati_draw_buffers/arbfp.c
@@ -69,7 +69,7 @@ attach_texture(int i)
 				  GL_TEXTURE_2D,
 				  tex,
 				  0);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	return tex;
 }
diff --git a/tests/spec/ext_packed_depth_stencil/readpixels-24_8.c b/tests/spec/ext_packed_depth_stencil/readpixels-24_8.c
index dd3afc0..71e038a 100644
--- a/tests/spec/ext_packed_depth_stencil/readpixels-24_8.c
+++ b/tests/spec/ext_packed_depth_stencil/readpixels-24_8.c
@@ -80,7 +80,7 @@ test()
 
 	glGenFramebuffersEXT(1, &fb);
 	glBindFramebufferEXT(GL_FRAMEBUFFER, fb);
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	glGenRenderbuffersEXT(1, &rb);
 	glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, rb);
diff --git a/tests/spec/ext_transform_feedback/interleaved.c b/tests/spec/ext_transform_feedback/interleaved.c
index 8b02fc7..ef36073 100644
--- a/tests/spec/ext_transform_feedback/interleaved.c
+++ b/tests/spec/ext_transform_feedback/interleaved.c
@@ -98,7 +98,7 @@ void piglit_init(int argc, char **argv)
 	glUnmapBuffer(GL_TRANSFORM_FEEDBACK_BUFFER_EXT);
 	glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER_EXT, 0, buf);
 
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	glClearColor(0.2, 0.2, 0.2, 1.0);
 	glEnableClientState(GL_VERTEX_ARRAY);
@@ -178,7 +178,7 @@ enum piglit_result piglit_display(void)
 	glEndTransformFeedback();
 	glDisable(GL_RASTERIZER_DISCARD);
 
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	ptr = glMapBuffer(GL_TRANSFORM_FEEDBACK_BUFFER_EXT, GL_READ_ONLY);
 	for (i = 0; i < BUF_FLOATS; i++) {
@@ -193,7 +193,7 @@ enum piglit_result piglit_display(void)
 	//puts("");
 	glUnmapBuffer(GL_TRANSFORM_FEEDBACK_BUFFER_EXT);
 
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	piglit_present_results();
 
diff --git a/tests/spec/ext_transform_feedback/output-type.c b/tests/spec/ext_transform_feedback/output-type.c
index 6442d63..e42d19d 100644
--- a/tests/spec/ext_transform_feedback/output-type.c
+++ b/tests/spec/ext_transform_feedback/output-type.c
@@ -1525,11 +1525,11 @@ test_ready:
 			     test->num_elements[j]*NUM_VERTICES*sizeof(float),
 			     data, GL_STREAM_READ);
 
-		assert(glGetError() == 0);
+		piglit_check_gl_error(0);
 
 		glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER_EXT, j, buf[j]);
 
-		assert(glGetError() == 0);
+		piglit_check_gl_error(0);
 
 		free(data);
 	}
@@ -1562,7 +1562,7 @@ enum piglit_result piglit_display(void)
 	glDrawArrays(GL_TRIANGLES, 0, NUM_VERTICES);
 	glEndTransformFeedback();
 
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	for (j = 0; j < MAX_BUFFERS; j++) {
 		if (!test->num_elements[j]) {
@@ -1594,7 +1594,7 @@ enum piglit_result piglit_display(void)
 			}
 		}
 		glUnmapBuffer(GL_TRANSFORM_FEEDBACK_BUFFER_EXT);
-		assert(glGetError() == 0);
+		piglit_check_gl_error(0);
 	}
 
 	piglit_present_results();
diff --git a/tests/spec/ext_transform_feedback/position.c b/tests/spec/ext_transform_feedback/position.c
index 665ed01..a3e2ded 100644
--- a/tests/spec/ext_transform_feedback/position.c
+++ b/tests/spec/ext_transform_feedback/position.c
@@ -133,7 +133,7 @@ void piglit_init(int argc, char **argv)
 	glBufferData(GL_TRANSFORM_FEEDBACK_BUFFER_EXT,
 		     BUF_FLOATS*sizeof(float), data, GL_STREAM_READ);
 
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	if (range) {
 		puts("Testing BindBufferRange.");
@@ -154,7 +154,7 @@ void piglit_init(int argc, char **argv)
 		range = MAX_RANGE/2; /* just one primitive is going to be written */
 	}
 
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	glClearColor(0.2, 0.2, 0.2, 1.0);
 	glEnableClientState(GL_VERTEX_ARRAY);
@@ -225,7 +225,7 @@ enum piglit_result piglit_display(void)
 	if (discard)
 		glDisable(GL_RASTERIZER_DISCARD_EXT);
 
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	switch (test) {
 	case READBACK:
@@ -287,7 +287,7 @@ enum piglit_result piglit_display(void)
 	pass = piglit_probe_pixel_rgb(5, 5, clearcolor) && pass;
 	pass = piglit_probe_pixel_rgb(15, 15, discard ? clearcolor : white) && pass;
 
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	piglit_present_results();
 
diff --git a/tests/spec/ext_transform_feedback/separate.c b/tests/spec/ext_transform_feedback/separate.c
index 7cab4ce..ddd0278 100644
--- a/tests/spec/ext_transform_feedback/separate.c
+++ b/tests/spec/ext_transform_feedback/separate.c
@@ -107,7 +107,7 @@ void piglit_init(int argc, char **argv)
 		glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER_EXT, i, buf[i]);
 	}
 
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	glClearColor(0.2, 0.2, 0.2, 1.0);
 	glEnableClientState(GL_VERTEX_ARRAY);
@@ -139,7 +139,7 @@ enum piglit_result piglit_display(void)
 	glEndTransformFeedback();
 	glDisable(GL_RASTERIZER_DISCARD);
 
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	pass = piglit_probe_buffer(buf[0], GL_TRANSFORM_FEEDBACK_BUFFER_EXT,
 			"Buffer[0]", NUM_OUT_VERTICES, 3, v3) && pass;
@@ -150,7 +150,7 @@ enum piglit_result piglit_display(void)
 	pass = piglit_probe_buffer(buf[3], GL_TRANSFORM_FEEDBACK_BUFFER_EXT,
 			"Buffer[3]", NUM_OUT_VERTICES, 4, texcoord1) && pass;
 
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	piglit_present_results();
 
diff --git a/tests/texturing/tex-miplevel-selection.c b/tests/texturing/tex-miplevel-selection.c
index 761f9ae..b2d4326 100644
--- a/tests/texturing/tex-miplevel-selection.c
+++ b/tests/texturing/tex-miplevel-selection.c
@@ -860,7 +860,7 @@ piglit_init(int argc, char **argv)
 	default:
 		assert(0);
 	}
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	if (test == FIXED_FUNCTION)
 		glDisable(gltarget);
@@ -900,7 +900,7 @@ piglit_init(int argc, char **argv)
 							  tex, level, layer);
 				break;
 			}
-			assert(glGetError() == 0);
+			piglit_check_gl_error(0);
 
 			status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER);
 			if (status != GL_FRAMEBUFFER_COMPLETE) {
@@ -960,7 +960,7 @@ piglit_init(int argc, char **argv)
 				glClear(clearbits);
 			}
 
-			assert(glGetError() == 0);
+			piglit_check_gl_error(0);
 		}
 
 		if (gltarget == GL_TEXTURE_RECTANGLE)
@@ -998,7 +998,7 @@ piglit_init(int argc, char **argv)
 		glSamplerParameteri(samp[1], GL_TEXTURE_COMPARE_FUNC, GL_GREATER);
 	}
 
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 }
 
 #define SET_VEC(c, x, y, z, w) do { c[0] = x; c[1] = y; c[2] = z; c[3] = w; } while (0)
@@ -1529,7 +1529,7 @@ piglit_display(void)
 	}
 
 end:
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 	printf("Summary: %i/%i passed\n", total-failed, total);
 
 	piglit_present_results();
diff --git a/tests/texturing/texwrap.c b/tests/texturing/texwrap.c
index 82bcf07..d0e8069 100644
--- a/tests/texturing/texwrap.c
+++ b/tests/texturing/texwrap.c
@@ -1146,7 +1146,7 @@ enum piglit_result piglit_display()
 			}
 		}
 	}
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	return pass ? PIGLIT_PASS : PIGLIT_FAIL;
 }
@@ -1635,7 +1635,7 @@ static void init_texture(const struct format_desc *format, GLboolean npot)
 					baseformat, type, (void *) data);
 		break;
 	}
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	if (data != image) {
 		free(data);
@@ -1803,7 +1803,7 @@ outer_continue:;
 	default:;
 	}
 
-	assert(glGetError() == 0);
+	piglit_check_gl_error(0);
 
 	if (!piglit_automatic) {
 		piglit_set_keyboard_func(key_func);
-- 
1.9.3



More information about the Piglit mailing list