summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuliet fru <julietfru@gmail.com>2014-10-20 21:26:20 +0100
committerBrian Paul <brianp@vmware.com>2014-10-21 14:37:07 -0600
commitad8bd91a3e2fd653afa3fc90e061965d07c7d26f (patch)
tree3f2c3187847b0d8e2655a22d7bc52d6c7b228948
parenta636a3610d7cd8d59986e547bde52cfcc3fb7dab (diff)
Replaced assert(glGetError()) with gl_check_gl_error()
Report PIGLIT_FAIL if there's an unexpected error. Reviewed-by: Brian Paul <brianp@vmware.com>
-rw-r--r--TODO3
-rw-r--r--tests/bugs/fdo14575.c9
-rw-r--r--tests/fbo/fbo-1d.c6
-rw-r--r--tests/fbo/fbo-3d.c6
-rw-r--r--tests/fbo/fbo-alpha.c3
-rw-r--r--tests/fbo/fbo-alphatest-formats.c3
-rw-r--r--tests/fbo/fbo-alphatest-nocolor-ff.c6
-rw-r--r--tests/fbo/fbo-alphatest-nocolor.c6
-rw-r--r--tests/fbo/fbo-array.c9
-rw-r--r--tests/fbo/fbo-blending-formats.c3
-rw-r--r--tests/fbo/fbo-blit-d24s8.c9
-rw-r--r--tests/fbo/fbo-blit-stretch.cpp3
-rw-r--r--tests/fbo/fbo-blit.c3
-rw-r--r--tests/fbo/fbo-clearmipmap.c6
-rw-r--r--tests/fbo/fbo-colormask-formats.c3
-rw-r--r--tests/fbo/fbo-copypix.c3
-rw-r--r--tests/fbo/fbo-copyteximage-simple.c6
-rw-r--r--tests/fbo/fbo-copyteximage.c6
-rw-r--r--tests/fbo/fbo-cubemap.c6
-rw-r--r--tests/fbo/fbo-depth-array.c21
-rw-r--r--tests/fbo/fbo-depth-sample-compare.c12
-rw-r--r--tests/fbo/fbo-depth-tex1d.c9
-rw-r--r--tests/fbo/fbo-depth.c3
-rw-r--r--tests/fbo/fbo-depthstencil.c3
-rw-r--r--tests/fbo/fbo-drawbuffers-arbfp.c3
-rw-r--r--tests/fbo/fbo-drawbuffers-blend-add.c3
-rw-r--r--tests/fbo/fbo-drawbuffers-fragcolor.c3
-rw-r--r--tests/fbo/fbo-drawbuffers-maxtargets.c3
-rw-r--r--tests/fbo/fbo-drawbuffers.c3
-rw-r--r--tests/fbo/fbo-drawbuffers2-blend.c3
-rw-r--r--tests/fbo/fbo-drawbuffers2-colormask.c3
-rw-r--r--tests/fbo/fbo-finish-deleted.c3
-rw-r--r--tests/fbo/fbo-flushing-2.c3
-rw-r--r--tests/fbo/fbo-flushing.c3
-rw-r--r--tests/fbo/fbo-fragcoord.c9
-rw-r--r--tests/fbo/fbo-generatemipmap-array.c18
-rw-r--r--tests/fbo/fbo-generatemipmap-formats.c9
-rw-r--r--tests/fbo/fbo-generatemipmap-nonsquare.c6
-rw-r--r--tests/fbo/fbo-generatemipmap-npot.c6
-rw-r--r--tests/fbo/fbo-generatemipmap-scissor.c6
-rw-r--r--tests/fbo/fbo-generatemipmap-swizzle.c6
-rw-r--r--tests/fbo/fbo-generatemipmap-viewport.c6
-rw-r--r--tests/fbo/fbo-generatemipmap.c6
-rw-r--r--tests/fbo/fbo-luminance-alpha.c3
-rw-r--r--tests/fbo/fbo-maxsize.c3
-rw-r--r--tests/fbo/fbo-nodepth-test.c3
-rw-r--r--tests/fbo/fbo-nostencil-test.c3
-rw-r--r--tests/fbo/fbo-pbo-readpixels-small.c3
-rw-r--r--tests/fbo/fbo-readdrawpix.c3
-rw-r--r--tests/fbo/fbo-readpixels-depth-formats.c3
-rw-r--r--tests/fbo/fbo-readpixels.c3
-rw-r--r--tests/fbo/fbo-rg.c6
-rw-r--r--tests/fbo/fbo-srgb.c6
-rw-r--r--tests/fbo/fbo-stencil.c3
-rw-r--r--tests/fbo/fbo-viewport.c3
-rw-r--r--tests/general/attribs.c3
-rw-r--r--tests/general/draw-elements.c3
-rw-r--r--tests/general/draw-vertices-half-float.c3
-rw-r--r--tests/general/draw-vertices.c3
-rw-r--r--tests/general/framebuffer-srgb.c3
-rw-r--r--tests/general/stencil-drawpixels.c3
-rw-r--r--tests/general/triangle-rasterization-overdraw.cpp3
-rw-r--r--tests/general/triangle-rasterization.cpp6
-rw-r--r--tests/shaders/glsl-cos.c3
-rw-r--r--tests/shaders/glsl-fs-discard-02.c3
-rw-r--r--tests/shaders/glsl-kwin-blur-1.c3
-rw-r--r--tests/shaders/glsl-kwin-blur-2.c3
-rw-r--r--tests/shaders/glsl-routing.c3
-rw-r--r--tests/shaders/glsl-sin.c3
-rw-r--r--tests/spec/arb_draw_elements_base_vertex/negative-index.c3
-rw-r--r--tests/spec/arb_es2_compatibility/arb_es2_compatibility-drawbuffers.c6
-rw-r--r--tests/spec/arb_framebuffer_srgb/srgb_conformance.c6
-rw-r--r--tests/spec/arb_map_buffer_range/invalidate.c3
-rw-r--r--tests/spec/arb_map_buffer_range/map_buffer_range_error_check.c3
-rw-r--r--tests/spec/arb_sampler_objects/framebufferblit.c3
-rw-r--r--tests/spec/arb_shader_texture_lod/execution/texgrad.c6
-rw-r--r--tests/spec/arb_shader_texture_lod/execution/texgradcube.c6
-rw-r--r--tests/spec/arb_texture_cube_map_array/fbo-cubemap-array.c9
-rw-r--r--tests/spec/arb_transform_feedback2/draw-auto.c9
-rw-r--r--tests/spec/arb_vertex_type_2_10_10_10_rev/draw-vertices-2101010.c3
-rw-r--r--tests/spec/ati_draw_buffers/arbfp-no-index.c3
-rw-r--r--tests/spec/ati_draw_buffers/arbfp-no-option.c3
-rw-r--r--tests/spec/ati_draw_buffers/arbfp.c3
-rw-r--r--tests/spec/ext_packed_depth_stencil/readpixels-24_8.c3
-rw-r--r--tests/spec/ext_transform_feedback/interleaved.c9
-rw-r--r--tests/spec/ext_transform_feedback/output-type.c12
-rw-r--r--tests/spec/ext_transform_feedback/position.c12
-rw-r--r--tests/spec/ext_transform_feedback/separate.c9
-rw-r--r--tests/texturing/tex-miplevel-selection.c15
-rw-r--r--tests/texturing/texwrap.c9
90 files changed, 312 insertions, 159 deletions
diff --git a/TODO b/TODO
index fb5c405ad..eacda795d 100644
--- a/TODO
+++ b/TODO
@@ -10,9 +10,6 @@ See https://bugs.freedesktop.org/show_bug.cgi?id=65676 for more details.
Move/rename tests in the bugs/ directory to proper places under tests/spec/
-Replace calls such as assert(glGetError() == 0) with piglit_check_gl_error().
-
-
Quite a few tests have GL enum names encoded in tables. For example, in
tests/texturing/texture-rg.c:
diff --git a/tests/bugs/fdo14575.c b/tests/bugs/fdo14575.c
index b2f780b42..a6125dc8b 100644
--- a/tests/bugs/fdo14575.c
+++ b/tests/bugs/fdo14575.c
@@ -55,7 +55,8 @@ 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);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
/* Then, another normal path: create, map, write, unmap, delete */
glBindBufferARB(GL_ARRAY_BUFFER_ARB, buf);
@@ -64,7 +65,8 @@ piglit_init(int argc, char**argv)
*v = data;
glUnmapBufferARB(GL_ARRAY_BUFFER_ARB);
glDeleteBuffersARB(1, &buf);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
/* Then, do the failing path: create, map, delete */
glBindBufferARB(GL_ARRAY_BUFFER_ARB, buf);
@@ -72,7 +74,8 @@ 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);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
piglit_report_result(PIGLIT_PASS);
}
diff --git a/tests/fbo/fbo-1d.c b/tests/fbo/fbo-1d.c
index 382febfac..63f36be46 100644
--- a/tests/fbo/fbo-1d.c
+++ b/tests/fbo/fbo-1d.c
@@ -56,7 +56,8 @@ create_1d_fbo(void)
BUF_WIDTH,
0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
glGenFramebuffersEXT(1, &fb);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
@@ -67,7 +68,8 @@ create_1d_fbo(void)
tex,
0);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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 4848f2bfa..61f77ec2e 100644
--- a/tests/fbo/fbo-3d.c
+++ b/tests/fbo/fbo-3d.c
@@ -76,7 +76,8 @@ create_3d_fbo(void)
BUF_WIDTH, BUF_HEIGHT, pot_depth,
0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
glGenFramebuffersEXT(1, &fb);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
@@ -90,7 +91,8 @@ create_3d_fbo(void)
0,
depth);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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 48da04c47..86e4db56a 100644
--- a/tests/fbo/fbo-alpha.c
+++ b/tests/fbo/fbo-alpha.c
@@ -73,7 +73,8 @@ piglit_display(void)
GL_TEXTURE_2D,
tex,
0);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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 a51d66c4b..cb07f1d3d 100644
--- a/tests/fbo/fbo-alphatest-formats.c
+++ b/tests/fbo/fbo-alphatest-formats.c
@@ -172,7 +172,8 @@ static enum piglit_result test_format(const struct format_desc *format)
GL_TEXTURE_2D,
tex,
0);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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 e04a62605..7528c3d5d 100644
--- a/tests/fbo/fbo-alphatest-nocolor-ff.c
+++ b/tests/fbo/fbo-alphatest-nocolor-ff.c
@@ -51,7 +51,8 @@ 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);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
/* Create the FBO. */
glGenFramebuffersEXT(1, &fb);
@@ -76,7 +77,8 @@ static void create_fbo(GLuint *out_tex)
glClearDepth(0.0);
glClear(GL_DEPTH_BUFFER_BIT);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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 0294a18b3..ff7b14950 100644
--- a/tests/fbo/fbo-alphatest-nocolor.c
+++ b/tests/fbo/fbo-alphatest-nocolor.c
@@ -66,7 +66,8 @@ 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);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
/* Create the FBO. */
glGenFramebuffersEXT(1, &fb);
@@ -91,7 +92,8 @@ static void create_fbo(GLuint *out_tex)
glClearDepth(0.0);
glClear(GL_DEPTH_BUFFER_BIT);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_GREATER, 0.5f);
diff --git a/tests/fbo/fbo-array.c b/tests/fbo/fbo-array.c
index 6f1e8775c..94c88c9df 100644
--- a/tests/fbo/fbo-array.c
+++ b/tests/fbo/fbo-array.c
@@ -93,14 +93,16 @@ create_array_fbo(void)
glGenTextures(1, &tex);
glBindTexture(GL_TEXTURE_2D_ARRAY_EXT, tex);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
/* 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);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
glGenFramebuffersEXT(1, &fb);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
@@ -113,7 +115,8 @@ create_array_fbo(void)
0,
layer);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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 3e6acd2d4..4632944a9 100644
--- a/tests/fbo/fbo-blending-formats.c
+++ b/tests/fbo/fbo-blending-formats.c
@@ -280,7 +280,8 @@ static enum piglit_result test_format(const struct format_desc *format)
GL_TEXTURE_2D,
tex,
0);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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 dcee91848..c0fc772d8 100644
--- a/tests/fbo/fbo-blit-d24s8.c
+++ b/tests/fbo/fbo-blit-d24s8.c
@@ -81,7 +81,8 @@ make_fbo(int w, int h)
glDrawBuffer(GL_NONE);
glReadBuffer(GL_NONE);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
@@ -229,7 +230,8 @@ run_test(void)
GL_DEPTH_BUFFER_BIT);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
printf("Verify 1\n");
pass = verify_depth_rect(PAD, y0, SIZE, SIZE) && pass;
@@ -243,7 +245,8 @@ 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);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
piglit_present_results();
diff --git a/tests/fbo/fbo-blit-stretch.cpp b/tests/fbo/fbo-blit-stretch.cpp
index 8235ec427..75c787a6b 100644
--- a/tests/fbo/fbo-blit-stretch.cpp
+++ b/tests/fbo/fbo-blit-stretch.cpp
@@ -353,7 +353,8 @@ run_test(const TestCase &test)
GL_TEXTURE_2D,
tex,
0);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
if (status != GL_FRAMEBUFFER_COMPLETE) {
diff --git a/tests/fbo/fbo-blit.c b/tests/fbo/fbo-blit.c
index 79b302089..33963b699 100644
--- a/tests/fbo/fbo-blit.c
+++ b/tests/fbo/fbo-blit.c
@@ -77,7 +77,8 @@ make_fbo(int w, int h)
target,
tex,
0);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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 7b066c03f..0e2fdd6dd 100644
--- a/tests/fbo/fbo-clearmipmap.c
+++ b/tests/fbo/fbo-clearmipmap.c
@@ -76,7 +76,8 @@ piglit_init(int argc, char **argv)
0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
}
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
glBindTexture(GL_TEXTURE_2D, 0);
glDisable(GL_TEXTURE_2D);
@@ -104,7 +105,8 @@ piglit_init(int argc, char **argv)
0.0);
glClear(GL_COLOR_BUFFER_BIT);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
}
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 2f23d4d3e..71e6bff52 100644
--- a/tests/fbo/fbo-colormask-formats.c
+++ b/tests/fbo/fbo-colormask-formats.c
@@ -145,7 +145,8 @@ static enum piglit_result test_format(const struct format_desc *format)
GL_TEXTURE_2D,
tex,
0);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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 a3ae5633a..5919d2a59 100644
--- a/tests/fbo/fbo-copypix.c
+++ b/tests/fbo/fbo-copypix.c
@@ -72,7 +72,8 @@ make_fbo(int w, int h)
GL_TEXTURE_2D,
tex,
0);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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 511b97b69..4aefb29d0 100644
--- a/tests/fbo/fbo-copyteximage-simple.c
+++ b/tests/fbo/fbo-copyteximage-simple.c
@@ -67,7 +67,8 @@ create_fbo(void)
0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
glGenFramebuffersEXT(1, &fb);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
@@ -76,7 +77,8 @@ create_fbo(void)
GL_TEXTURE_2D,
tex,
0);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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 e0b47f7e3..c4a0f3f10 100644
--- a/tests/fbo/fbo-copyteximage.c
+++ b/tests/fbo/fbo-copyteximage.c
@@ -68,7 +68,8 @@ create_fbo(void)
0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
}
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
/* Draw into the second level. */
glGenFramebuffersEXT(1, &fb);
@@ -78,7 +79,8 @@ create_fbo(void)
GL_TEXTURE_2D,
tex,
1);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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 2eb45afc9..721b0e448 100644
--- a/tests/fbo/fbo-cubemap.c
+++ b/tests/fbo/fbo-cubemap.c
@@ -82,7 +82,8 @@ create_cube_fbo(void)
level++;
}
}
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
glGenFramebuffersEXT(1, &fb);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
@@ -97,7 +98,8 @@ create_cube_fbo(void)
tex,
level);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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 84370e4a7..38a9b9f6e 100644
--- a/tests/fbo/fbo-depth-array.c
+++ b/tests/fbo/fbo-depth-array.c
@@ -225,13 +225,15 @@ create_array_fbo(void)
glGenTextures(1, &tex);
glBindTexture(GL_TEXTURE_2D_ARRAY, tex);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
/* 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);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
glGenFramebuffers(1, &fb);
glBindFramebuffer(GL_FRAMEBUFFER, fb);
@@ -271,7 +273,8 @@ create_array_fbo(void)
0,
layer);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
if (status != GL_FRAMEBUFFER_COMPLETE) {
@@ -347,7 +350,8 @@ create_array_fbo(void)
done:
glDeleteFramebuffers(1, &fb);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
return tex;
}
@@ -385,7 +389,8 @@ draw_layer(int x, int y, int depth)
(double)height / piglit_height * 2,
0, 0, 1, 1);
glUseProgram(0);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
}
static GLboolean test_layer_drawing(int start_x, int start_y, float expected)
@@ -433,7 +438,8 @@ test_once(void)
}
glDeleteTextures(1, &tex);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
return pass;
}
@@ -506,5 +512,6 @@ void piglit_init(int argc, char **argv)
program_fs_empty = piglit_build_simple_program(vs_text,
frag_shader_empty_text);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
}
diff --git a/tests/fbo/fbo-depth-sample-compare.c b/tests/fbo/fbo-depth-sample-compare.c
index 72f7d0054..d6f7504cb 100644
--- a/tests/fbo/fbo-depth-sample-compare.c
+++ b/tests/fbo/fbo-depth-sample-compare.c
@@ -83,7 +83,8 @@ create_fbo(void)
glTexImage2D(TexTarget, 0, depthIntFormat,
SIZE, SIZE, 0,
GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
glGetTexLevelParameteriv(TexTarget, 0, GL_TEXTURE_DEPTH_SIZE, &Zbits);
/* color texture */
@@ -94,7 +95,8 @@ create_fbo(void)
glTexImage2D(TexTarget, 0, GL_RGBA,
SIZE, SIZE, 0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
/* Create FBO */
glGenFramebuffersEXT(1, &FBO);
@@ -112,7 +114,8 @@ create_fbo(void)
DepthTex,
0);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
@@ -315,7 +318,8 @@ show_depth_fbo(void)
glWindowPos2i(SIZE, 0);
glDrawPixels(SIZE, SIZE, GL_LUMINANCE, GL_FLOAT, zf);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
#if DEBUG
{
diff --git a/tests/fbo/fbo-depth-tex1d.c b/tests/fbo/fbo-depth-tex1d.c
index e4df8ecfd..51acd9af0 100644
--- a/tests/fbo/fbo-depth-tex1d.c
+++ b/tests/fbo/fbo-depth-tex1d.c
@@ -84,13 +84,15 @@ static void create_1d_fbo(GLuint *out_tex, GLuint *out_ds)
BUF_WIDTH,
0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
/* 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);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
/* Create the FBO. */
glGenFramebuffersEXT(1, &fb);
@@ -116,7 +118,8 @@ static void create_1d_fbo(GLuint *out_tex, GLuint *out_ds)
0);
}
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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 196c51f81..28570a19e 100644
--- a/tests/fbo/fbo-depth.c
+++ b/tests/fbo/fbo-depth.c
@@ -311,7 +311,8 @@ enum piglit_result piglit_display(void)
piglit_present_results();
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
return res;
}
diff --git a/tests/fbo/fbo-depthstencil.c b/tests/fbo/fbo-depthstencil.c
index 43a308041..a4cdb7972 100644
--- a/tests/fbo/fbo-depthstencil.c
+++ b/tests/fbo/fbo-depthstencil.c
@@ -480,7 +480,8 @@ enum piglit_result piglit_display(void)
piglit_present_results();
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
return res;
}
diff --git a/tests/fbo/fbo-drawbuffers-arbfp.c b/tests/fbo/fbo-drawbuffers-arbfp.c
index e5b2117b4..a4e6b96e2 100644
--- a/tests/fbo/fbo-drawbuffers-arbfp.c
+++ b/tests/fbo/fbo-drawbuffers-arbfp.c
@@ -69,7 +69,8 @@ attach_texture(int i)
GL_TEXTURE_2D,
tex,
0);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
return tex;
}
diff --git a/tests/fbo/fbo-drawbuffers-blend-add.c b/tests/fbo/fbo-drawbuffers-blend-add.c
index b045f2379..1ba73df6b 100644
--- a/tests/fbo/fbo-drawbuffers-blend-add.c
+++ b/tests/fbo/fbo-drawbuffers-blend-add.c
@@ -104,7 +104,8 @@ attach_texture(int i)
GL_TEXTURE_2D,
tex,
0);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
return tex;
}
diff --git a/tests/fbo/fbo-drawbuffers-fragcolor.c b/tests/fbo/fbo-drawbuffers-fragcolor.c
index 1e75ded4a..dea5e330f 100644
--- a/tests/fbo/fbo-drawbuffers-fragcolor.c
+++ b/tests/fbo/fbo-drawbuffers-fragcolor.c
@@ -77,7 +77,8 @@ attach_texture(int i)
GL_TEXTURE_2D,
tex,
0);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
return tex;
}
diff --git a/tests/fbo/fbo-drawbuffers-maxtargets.c b/tests/fbo/fbo-drawbuffers-maxtargets.c
index 795d039e7..8a6014a22 100644
--- a/tests/fbo/fbo-drawbuffers-maxtargets.c
+++ b/tests/fbo/fbo-drawbuffers-maxtargets.c
@@ -105,7 +105,8 @@ attach_texture(int i)
GL_TEXTURE_2D,
tex,
0);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
return tex;
}
diff --git a/tests/fbo/fbo-drawbuffers.c b/tests/fbo/fbo-drawbuffers.c
index 4b72f27b5..261bcc7cc 100644
--- a/tests/fbo/fbo-drawbuffers.c
+++ b/tests/fbo/fbo-drawbuffers.c
@@ -61,7 +61,8 @@ attach_texture(int i)
GL_TEXTURE_2D,
tex,
0);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
return tex;
}
diff --git a/tests/fbo/fbo-drawbuffers2-blend.c b/tests/fbo/fbo-drawbuffers2-blend.c
index 4702137d1..33d17ec33 100644
--- a/tests/fbo/fbo-drawbuffers2-blend.c
+++ b/tests/fbo/fbo-drawbuffers2-blend.c
@@ -60,7 +60,8 @@ attach_texture(int i)
GL_TEXTURE_2D,
tex,
0);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
return tex;
}
diff --git a/tests/fbo/fbo-drawbuffers2-colormask.c b/tests/fbo/fbo-drawbuffers2-colormask.c
index 84d1ac80c..abb7738db 100644
--- a/tests/fbo/fbo-drawbuffers2-colormask.c
+++ b/tests/fbo/fbo-drawbuffers2-colormask.c
@@ -62,7 +62,8 @@ attach_texture(int i)
GL_TEXTURE_2D,
tex,
0);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
return tex;
}
diff --git a/tests/fbo/fbo-finish-deleted.c b/tests/fbo/fbo-finish-deleted.c
index 489565765..42a4ea8e5 100644
--- a/tests/fbo/fbo-finish-deleted.c
+++ b/tests/fbo/fbo-finish-deleted.c
@@ -72,7 +72,8 @@ void piglit_init(int argc, char **argv)
GL_TEXTURE_2D,
tex,
0);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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 011b4d66b..bda2308c3 100644
--- a/tests/fbo/fbo-flushing-2.c
+++ b/tests/fbo/fbo-flushing-2.c
@@ -78,7 +78,8 @@ piglit_display(void)
GL_TEXTURE_2D,
tex,
0);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
assert(glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT) ==
GL_FRAMEBUFFER_COMPLETE_EXT);
diff --git a/tests/fbo/fbo-flushing.c b/tests/fbo/fbo-flushing.c
index 8bb1290e4..07d9c0249 100644
--- a/tests/fbo/fbo-flushing.c
+++ b/tests/fbo/fbo-flushing.c
@@ -78,7 +78,8 @@ piglit_display(void)
GL_TEXTURE_2D,
tex,
0);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
assert(glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT) ==
GL_FRAMEBUFFER_COMPLETE_EXT);
diff --git a/tests/fbo/fbo-fragcoord.c b/tests/fbo/fbo-fragcoord.c
index e18e24dab..6d1befd93 100644
--- a/tests/fbo/fbo-fragcoord.c
+++ b/tests/fbo/fbo-fragcoord.c
@@ -57,13 +57,15 @@ 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);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
glGenFramebuffersEXT(1, &fb);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
GL_TEXTURE_2D, tex, 0);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
@@ -121,7 +123,8 @@ piglit_display(void)
glDeleteTextures(1, &tex);
glDeleteFramebuffersEXT(1, &fb);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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 be3c49818..2c443bb1c 100644
--- a/tests/fbo/fbo-generatemipmap-array.c
+++ b/tests/fbo/fbo-generatemipmap-array.c
@@ -135,14 +135,16 @@ create_array_fbo_1d(void)
glGenTextures(1, &tex);
glBindTexture(GL_TEXTURE_1D_ARRAY_EXT, tex);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
glGenFramebuffersEXT(1, &fb);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
@@ -153,7 +155,8 @@ create_array_fbo_1d(void)
tex,
0,
layer);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
@@ -222,14 +225,16 @@ create_array_fbo_2d(void)
glGenTextures(1, &tex);
glBindTexture(GL_TEXTURE_2D_ARRAY_EXT, tex);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
glGenFramebuffersEXT(1, &fb);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
@@ -240,7 +245,8 @@ create_array_fbo_2d(void)
tex,
0,
layer);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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 9cb7d4ecd..f054453cf 100644
--- a/tests/fbo/fbo-generatemipmap-formats.c
+++ b/tests/fbo/fbo-generatemipmap-formats.c
@@ -82,7 +82,8 @@ 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);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
if (internalformat == GL_DEPTH32F_STENCIL8) {
format = GL_DEPTH_STENCIL;
type = GL_FLOAT_32_UNSIGNED_INT_24_8_REV;
@@ -117,7 +118,8 @@ create_tex(GLenum internalformat, GLenum baseformat, GLenum basetype)
0,
format, type, NULL);
}
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
glGenerateMipmapEXT(GL_TEXTURE_2D);
@@ -226,7 +228,8 @@ 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);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
break;
default:
diff --git a/tests/fbo/fbo-generatemipmap-nonsquare.c b/tests/fbo/fbo-generatemipmap-nonsquare.c
index 7a1ec1950..49cad8617 100644
--- a/tests/fbo/fbo-generatemipmap-nonsquare.c
+++ b/tests/fbo/fbo-generatemipmap-nonsquare.c
@@ -72,7 +72,8 @@ create_fbo(void)
0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
}
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
glGenFramebuffersEXT(1, &fb);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
@@ -81,7 +82,8 @@ create_fbo(void)
GL_TEXTURE_2D,
tex,
0);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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 6ea874605..6e830f75a 100644
--- a/tests/fbo/fbo-generatemipmap-npot.c
+++ b/tests/fbo/fbo-generatemipmap-npot.c
@@ -66,7 +66,8 @@ create_fbo(void)
0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
}
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
glGenFramebuffersEXT(1, &fb);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
@@ -75,7 +76,8 @@ create_fbo(void)
GL_TEXTURE_2D,
tex,
0);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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 d08850a55..05d38dda8 100644
--- a/tests/fbo/fbo-generatemipmap-scissor.c
+++ b/tests/fbo/fbo-generatemipmap-scissor.c
@@ -69,7 +69,8 @@ create_fbo(void)
0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
}
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
glGenFramebuffersEXT(1, &fb);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
@@ -78,7 +79,8 @@ create_fbo(void)
GL_TEXTURE_2D,
tex,
0);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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 4b80df4f3..c3d6a0c78 100644
--- a/tests/fbo/fbo-generatemipmap-swizzle.c
+++ b/tests/fbo/fbo-generatemipmap-swizzle.c
@@ -71,7 +71,8 @@ create_fbo(void)
0,
GL_RED, GL_UNSIGNED_BYTE, NULL);
}
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
glGenFramebuffersEXT(1, &fb);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
@@ -80,7 +81,8 @@ create_fbo(void)
GL_TEXTURE_2D,
tex,
0);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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 4e94d56bd..95c806f26 100644
--- a/tests/fbo/fbo-generatemipmap-viewport.c
+++ b/tests/fbo/fbo-generatemipmap-viewport.c
@@ -68,7 +68,8 @@ create_fbo(void)
0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
}
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
glGenFramebuffersEXT(1, &fb);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
@@ -77,7 +78,8 @@ create_fbo(void)
GL_TEXTURE_2D,
tex,
0);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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 656b0d4d4..619db1118 100644
--- a/tests/fbo/fbo-generatemipmap.c
+++ b/tests/fbo/fbo-generatemipmap.c
@@ -66,7 +66,8 @@ create_fbo(void)
0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
}
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
glGenFramebuffersEXT(1, &fb);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
@@ -75,7 +76,8 @@ create_fbo(void)
GL_TEXTURE_2D,
tex,
0);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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 8ece65348..e68ff6ff4 100644
--- a/tests/fbo/fbo-luminance-alpha.c
+++ b/tests/fbo/fbo-luminance-alpha.c
@@ -77,7 +77,8 @@ piglit_display(void)
GL_TEXTURE_2D,
tex,
0);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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 02ce0940d..64dcd9910 100644
--- a/tests/fbo/fbo-maxsize.c
+++ b/tests/fbo/fbo-maxsize.c
@@ -130,7 +130,8 @@ static int create_fbo(void)
GL_COLOR_ATTACHMENT0_EXT,
GL_TEXTURE_2D,
tex, 0);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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 9e86b170b..834e1c60e 100644
--- a/tests/fbo/fbo-nodepth-test.c
+++ b/tests/fbo/fbo-nodepth-test.c
@@ -65,7 +65,8 @@ piglit_display(void)
GL_TEXTURE_2D,
tex,
0);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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 0ca76ba7e..bf2d4e9f1 100644
--- a/tests/fbo/fbo-nostencil-test.c
+++ b/tests/fbo/fbo-nostencil-test.c
@@ -65,7 +65,8 @@ piglit_display(void)
GL_TEXTURE_2D,
tex,
0);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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 919c9fe5f..c7730b2bb 100644
--- a/tests/fbo/fbo-pbo-readpixels-small.c
+++ b/tests/fbo/fbo-pbo-readpixels-small.c
@@ -68,7 +68,8 @@ make_fbo(GLuint *fbo, GLuint *tex)
GL_TEXTURE_2D,
*tex,
0);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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 7d2e8f8c6..7a9e0e200 100644
--- a/tests/fbo/fbo-readdrawpix.c
+++ b/tests/fbo/fbo-readdrawpix.c
@@ -72,7 +72,8 @@ make_fbo(int w, int h)
GL_TEXTURE_2D,
tex,
0);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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 8b3fdac47..5fbcd5445 100644
--- a/tests/fbo/fbo-readpixels-depth-formats.c
+++ b/tests/fbo/fbo-readpixels-depth-formats.c
@@ -185,7 +185,8 @@ test_with_format(GLenum internal_format, const char *name)
glGenFramebuffersEXT(1, &fb);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
glGenRenderbuffersEXT(1, &rb);
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, rb);
diff --git a/tests/fbo/fbo-readpixels.c b/tests/fbo/fbo-readpixels.c
index d70fed041..5339c7ff5 100644
--- a/tests/fbo/fbo-readpixels.c
+++ b/tests/fbo/fbo-readpixels.c
@@ -87,7 +87,8 @@ test_with_format(GLenum internal_format, GLenum format,
GL_TEXTURE_2D,
tex,
0);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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 58a2de026..ad998c24c 100644
--- a/tests/fbo/fbo-rg.c
+++ b/tests/fbo/fbo-rg.c
@@ -108,13 +108,15 @@ 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);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
glGenFramebuffersEXT(1, &fb);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
GL_TEXTURE_2D, tex, 0);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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 a379d9df4..c19980119 100644
--- a/tests/fbo/fbo-srgb.c
+++ b/tests/fbo/fbo-srgb.c
@@ -72,7 +72,8 @@ make_fbo(int w, int h, int srgb_format, GLuint *tex_p)
GL_TEXTURE_2D,
tex,
0);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
@@ -123,7 +124,8 @@ framebuffer_srgb_fbo(int srgb_format)
fbo = make_fbo(fbo_width, fbo_height, srgb_format, &tex);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbo);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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 050d76115..04d64ea69 100644
--- a/tests/fbo/fbo-stencil.c
+++ b/tests/fbo/fbo-stencil.c
@@ -327,7 +327,8 @@ enum piglit_result piglit_display(void)
piglit_present_results();
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
return res;
}
diff --git a/tests/fbo/fbo-viewport.c b/tests/fbo/fbo-viewport.c
index d685f3690..9602b3d36 100644
--- a/tests/fbo/fbo-viewport.c
+++ b/tests/fbo/fbo-viewport.c
@@ -127,7 +127,8 @@ piglit_display(void)
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
GL_RENDERBUFFER, rb);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
assert(glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT) ==
GL_FRAMEBUFFER_COMPLETE_EXT);
diff --git a/tests/general/attribs.c b/tests/general/attribs.c
index f48d8b956..198f07523 100644
--- a/tests/general/attribs.c
+++ b/tests/general/attribs.c
@@ -528,7 +528,8 @@ enum piglit_result piglit_display(void)
}
}
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
piglit_present_results();
return pass ? PIGLIT_PASS : PIGLIT_FAIL;
diff --git a/tests/general/draw-elements.c b/tests/general/draw-elements.c
index 0f712c70c..29436cf2d 100644
--- a/tests/general/draw-elements.c
+++ b/tests/general/draw-elements.c
@@ -244,7 +244,8 @@ enum piglit_result
printf("%s\n", tests[i].name);
tests[i].test(x, y, x+20, y+20, tests[i].index);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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 37f1dc5a2..dfd2da852 100644
--- a/tests/general/draw-vertices-half-float.c
+++ b/tests/general/draw-vertices-half-float.c
@@ -196,7 +196,8 @@ piglit_display(void)
printf("%s\n", tests[i].name);
tests[i].test(x, y, x+20, y+20, tests[i].index);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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 cd48816c7..2a2041fc0 100644
--- a/tests/general/draw-vertices.c
+++ b/tests/general/draw-vertices.c
@@ -565,7 +565,8 @@ piglit_display(void)
printf("%s\n", tests[i].name);
tests[i].test(x, y, x+20, y+20, tests[i].index);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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 acae0f000..9f88df7d7 100644
--- a/tests/general/framebuffer-srgb.c
+++ b/tests/general/framebuffer-srgb.c
@@ -244,7 +244,8 @@ make_fbo(int w, int h)
GL_TEXTURE_2D,
tex,
0);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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 e04ec9ec5..1fdc47f5e 100644
--- a/tests/general/stencil-drawpixels.c
+++ b/tests/general/stencil-drawpixels.c
@@ -91,7 +91,8 @@ piglit_display(void)
glColor4fv(blue);
piglit_draw_rect(0, 0, piglit_width, piglit_height);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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 39303030c..45ae66a4a 100644
--- a/tests/general/triangle-rasterization-overdraw.cpp
+++ b/tests/general/triangle-rasterization-overdraw.cpp
@@ -281,7 +281,8 @@ piglit_display(void)
piglit_present_results();
}
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
return pass ? PIGLIT_PASS : PIGLIT_FAIL;
}
diff --git a/tests/general/triangle-rasterization.cpp b/tests/general/triangle-rasterization.cpp
index 0d99ef126..f93842fdb 100644
--- a/tests/general/triangle-rasterization.cpp
+++ b/tests/general/triangle-rasterization.cpp
@@ -541,7 +541,8 @@ piglit_display(void)
tex,
0);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
assert(glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT) == GL_FRAMEBUFFER_COMPLETE_EXT);
glBindTexture(GL_TEXTURE_2D, 0);
@@ -621,7 +622,8 @@ piglit_display(void)
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
}
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
return pass ? PIGLIT_PASS : PIGLIT_FAIL;
}
diff --git a/tests/shaders/glsl-cos.c b/tests/shaders/glsl-cos.c
index aebc7a41a..06b7b7f4c 100644
--- a/tests/shaders/glsl-cos.c
+++ b/tests/shaders/glsl-cos.c
@@ -86,7 +86,8 @@ static GLboolean test()
glUniform1f(location, (i - 25) * DEGREES_30);
piglit_draw_rect((i % 10) * 10, (i / 10) * 10, 10, 10);
}
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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 2401af53b..3277a3ed6 100644
--- a/tests/shaders/glsl-fs-discard-02.c
+++ b/tests/shaders/glsl-fs-discard-02.c
@@ -95,7 +95,8 @@ 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);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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 dd0fb0de4..68b4ca2ec 100644
--- a/tests/shaders/glsl-kwin-blur-1.c
+++ b/tests/shaders/glsl-kwin-blur-1.c
@@ -195,7 +195,8 @@ static GLboolean test()
glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
/* 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 0c03ff800..81cf0f41e 100644
--- a/tests/shaders/glsl-kwin-blur-2.c
+++ b/tests/shaders/glsl-kwin-blur-2.c
@@ -224,7 +224,8 @@ static GLboolean test()
glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
/* Test the sides */
for (i = 0; i < 26; i++) {
diff --git a/tests/shaders/glsl-routing.c b/tests/shaders/glsl-routing.c
index 6bbc4393c..6fb1c24a9 100644
--- a/tests/shaders/glsl-routing.c
+++ b/tests/shaders/glsl-routing.c
@@ -211,7 +211,8 @@ static GLboolean test(unsigned vsbitmask, unsigned fsbitmask, int line)
draw_rect(5 + (i*(BOX_SIZE+5)) % 240, 5 + height, i, attrib);
}
}
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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 192b4e29a..c154b2213 100644
--- a/tests/shaders/glsl-sin.c
+++ b/tests/shaders/glsl-sin.c
@@ -86,7 +86,8 @@ static GLboolean test()
glUniform1f(location, (i - 25) * DEGREES_30);
piglit_draw_rect((i % 10) * 10, (i / 10) * 10, 10, 10);
}
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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 e0667d3d2..0428e27b2 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,8 @@ 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);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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 0413534c0..e31aa597e 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,8 @@ attach_texture(int i)
GL_TEXTURE_2D,
tex,
0);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
return tex;
}
@@ -106,7 +107,8 @@ piglit_init(int argc, char **argv)
piglit_report_result(PIGLIT_FAIL);
}
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
glDeleteTextures(1, &tex0);
diff --git a/tests/spec/arb_framebuffer_srgb/srgb_conformance.c b/tests/spec/arb_framebuffer_srgb/srgb_conformance.c
index 94df79700..99018e294 100644
--- a/tests/spec/arb_framebuffer_srgb/srgb_conformance.c
+++ b/tests/spec/arb_framebuffer_srgb/srgb_conformance.c
@@ -94,7 +94,8 @@ static enum piglit_result test_format(void)
GL_TEXTURE_2D,
texfb,
0);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
printf("Testing using fb float format");
@@ -162,7 +163,8 @@ static enum piglit_result test_format(void)
texfb,
0);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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 8fb3996d8..a33b36758 100644
--- a/tests/spec/arb_map_buffer_range/invalidate.c
+++ b/tests/spec/arb_map_buffer_range/invalidate.c
@@ -236,7 +236,8 @@ enum piglit_result piglit_display(void)
}
glDeleteBuffers(1, &vbo);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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 fabc2033c..683b2533b 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,8 @@ 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);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
/* (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 10e3625fb..74348b826 100644
--- a/tests/spec/arb_sampler_objects/framebufferblit.c
+++ b/tests/spec/arb_sampler_objects/framebufferblit.c
@@ -71,7 +71,8 @@ piglit_display(void)
GL_TEXTURE_2D,
tex,
0);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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 ec09eda32..99f8e65d5 100644
--- a/tests/spec/arb_shader_texture_lod/execution/texgrad.c
+++ b/tests/spec/arb_shader_texture_lod/execution/texgrad.c
@@ -99,7 +99,8 @@ void piglit_init(int argc, char **argv)
0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
}
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
glBindTexture(GL_TEXTURE_2D, 0);
glDisable(GL_TEXTURE_2D);
@@ -126,7 +127,8 @@ void piglit_init(int argc, char **argv)
0.0);
glClear(GL_COLOR_BUFFER_BIT);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
}
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 aeaab4872..f3e20896c 100644
--- a/tests/spec/arb_shader_texture_lod/execution/texgradcube.c
+++ b/tests/spec/arb_shader_texture_lod/execution/texgradcube.c
@@ -100,7 +100,8 @@ void piglit_init(int argc, char **argv)
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
}
}
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
glBindTexture(GL_TEXTURE_CUBE_MAP, 0);
glDisable(GL_TEXTURE_CUBE_MAP);
@@ -128,7 +129,8 @@ void piglit_init(int argc, char **argv)
0.0);
glClear(GL_COLOR_BUFFER_BIT);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
}
}
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 980eadf44..a6c97fc88 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,16 @@ create_array_fbo(void)
glGenTextures(1, &tex);
glBindTexture(GL_TEXTURE_CUBE_MAP_ARRAY_ARB, tex);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
/* 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);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
glGenFramebuffersEXT(1, &fb);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
@@ -119,7 +121,8 @@ create_array_fbo(void)
0,
layer);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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 801abdec7..933d2c945 100644
--- a/tests/spec/arb_transform_feedback2/draw-auto.c
+++ b/tests/spec/arb_transform_feedback2/draw-auto.c
@@ -119,7 +119,8 @@ void piglit_init(int argc, char **argv)
glBindBufferBaseEXT(GL_TRANSFORM_FEEDBACK_BUFFER_EXT, 0, buf);
glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, 0);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
glClearColor(0.2, 0.2, 0.2, 1.0);
glEnableClientState(GL_VERTEX_ARRAY);
@@ -166,7 +167,8 @@ enum piglit_result piglit_display(void)
glEndTransformFeedbackEXT();
glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, 0);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
glUseProgram(instanced ? prog_notransform_instanced : prog_notransform);
glBindBuffer(GL_ARRAY_BUFFER, buf);
@@ -181,7 +183,8 @@ enum piglit_result piglit_display(void)
glDisableClientState(GL_COLOR_ARRAY);
glBindBuffer(GL_ARRAY_BUFFER, 0);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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 2c473725f..b848e2ba8 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,8 @@ piglit_display(void)
printf("%s\n", tests[i].name);
tests[i].test(x, y, x+20, y+20, tests[i].index);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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 4ca73314d..b928cab63 100644
--- a/tests/spec/ati_draw_buffers/arbfp-no-index.c
+++ b/tests/spec/ati_draw_buffers/arbfp-no-index.c
@@ -77,7 +77,8 @@ attach_texture(int i)
GL_TEXTURE_2D,
tex,
0);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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 b5202ae37..ae062cca0 100644
--- a/tests/spec/ati_draw_buffers/arbfp-no-option.c
+++ b/tests/spec/ati_draw_buffers/arbfp-no-option.c
@@ -71,7 +71,8 @@ attach_texture(int i)
GL_TEXTURE_2D,
tex,
0);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
return tex;
}
diff --git a/tests/spec/ati_draw_buffers/arbfp.c b/tests/spec/ati_draw_buffers/arbfp.c
index 7b25b1439..34805c3aa 100644
--- a/tests/spec/ati_draw_buffers/arbfp.c
+++ b/tests/spec/ati_draw_buffers/arbfp.c
@@ -69,7 +69,8 @@ attach_texture(int i)
GL_TEXTURE_2D,
tex,
0);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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 dd3afc0fd..7fb9ad8ac 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,8 @@ test()
glGenFramebuffersEXT(1, &fb);
glBindFramebufferEXT(GL_FRAMEBUFFER, fb);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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 8b02fc72f..53ed50f69 100644
--- a/tests/spec/ext_transform_feedback/interleaved.c
+++ b/tests/spec/ext_transform_feedback/interleaved.c
@@ -98,7 +98,8 @@ void piglit_init(int argc, char **argv)
glUnmapBuffer(GL_TRANSFORM_FEEDBACK_BUFFER_EXT);
glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER_EXT, 0, buf);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
glClearColor(0.2, 0.2, 0.2, 1.0);
glEnableClientState(GL_VERTEX_ARRAY);
@@ -178,7 +179,8 @@ enum piglit_result piglit_display(void)
glEndTransformFeedback();
glDisable(GL_RASTERIZER_DISCARD);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
ptr = glMapBuffer(GL_TRANSFORM_FEEDBACK_BUFFER_EXT, GL_READ_ONLY);
for (i = 0; i < BUF_FLOATS; i++) {
@@ -193,7 +195,8 @@ enum piglit_result piglit_display(void)
//puts("");
glUnmapBuffer(GL_TRANSFORM_FEEDBACK_BUFFER_EXT);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
piglit_present_results();
diff --git a/tests/spec/ext_transform_feedback/output-type.c b/tests/spec/ext_transform_feedback/output-type.c
index 6442d639f..d76c67d28 100644
--- a/tests/spec/ext_transform_feedback/output-type.c
+++ b/tests/spec/ext_transform_feedback/output-type.c
@@ -1525,11 +1525,13 @@ test_ready:
test->num_elements[j]*NUM_VERTICES*sizeof(float),
data, GL_STREAM_READ);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER_EXT, j, buf[j]);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
free(data);
}
@@ -1562,7 +1564,8 @@ enum piglit_result piglit_display(void)
glDrawArrays(GL_TRIANGLES, 0, NUM_VERTICES);
glEndTransformFeedback();
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
for (j = 0; j < MAX_BUFFERS; j++) {
if (!test->num_elements[j]) {
@@ -1594,7 +1597,8 @@ enum piglit_result piglit_display(void)
}
}
glUnmapBuffer(GL_TRANSFORM_FEEDBACK_BUFFER_EXT);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
}
piglit_present_results();
diff --git a/tests/spec/ext_transform_feedback/position.c b/tests/spec/ext_transform_feedback/position.c
index 665ed01bd..091b44c5b 100644
--- a/tests/spec/ext_transform_feedback/position.c
+++ b/tests/spec/ext_transform_feedback/position.c
@@ -133,7 +133,8 @@ void piglit_init(int argc, char **argv)
glBufferData(GL_TRANSFORM_FEEDBACK_BUFFER_EXT,
BUF_FLOATS*sizeof(float), data, GL_STREAM_READ);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
if (range) {
puts("Testing BindBufferRange.");
@@ -154,7 +155,8 @@ void piglit_init(int argc, char **argv)
range = MAX_RANGE/2; /* just one primitive is going to be written */
}
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
glClearColor(0.2, 0.2, 0.2, 1.0);
glEnableClientState(GL_VERTEX_ARRAY);
@@ -225,7 +227,8 @@ enum piglit_result piglit_display(void)
if (discard)
glDisable(GL_RASTERIZER_DISCARD_EXT);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
switch (test) {
case READBACK:
@@ -287,7 +290,8 @@ 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);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
piglit_present_results();
diff --git a/tests/spec/ext_transform_feedback/separate.c b/tests/spec/ext_transform_feedback/separate.c
index 7cab4cefe..3297d14d5 100644
--- a/tests/spec/ext_transform_feedback/separate.c
+++ b/tests/spec/ext_transform_feedback/separate.c
@@ -107,7 +107,8 @@ void piglit_init(int argc, char **argv)
glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER_EXT, i, buf[i]);
}
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
glClearColor(0.2, 0.2, 0.2, 1.0);
glEnableClientState(GL_VERTEX_ARRAY);
@@ -139,7 +140,8 @@ enum piglit_result piglit_display(void)
glEndTransformFeedback();
glDisable(GL_RASTERIZER_DISCARD);
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
pass = piglit_probe_buffer(buf[0], GL_TRANSFORM_FEEDBACK_BUFFER_EXT,
"Buffer[0]", NUM_OUT_VERTICES, 3, v3) && pass;
@@ -150,7 +152,8 @@ 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);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
piglit_present_results();
diff --git a/tests/texturing/tex-miplevel-selection.c b/tests/texturing/tex-miplevel-selection.c
index 761f9ae41..3c1473587 100644
--- a/tests/texturing/tex-miplevel-selection.c
+++ b/tests/texturing/tex-miplevel-selection.c
@@ -860,7 +860,8 @@ piglit_init(int argc, char **argv)
default:
assert(0);
}
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
if (test == FIXED_FUNCTION)
glDisable(gltarget);
@@ -900,7 +901,8 @@ piglit_init(int argc, char **argv)
tex, level, layer);
break;
}
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER);
if (status != GL_FRAMEBUFFER_COMPLETE) {
@@ -960,7 +962,8 @@ piglit_init(int argc, char **argv)
glClear(clearbits);
}
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
}
if (gltarget == GL_TEXTURE_RECTANGLE)
@@ -998,7 +1001,8 @@ piglit_init(int argc, char **argv)
glSamplerParameteri(samp[1], GL_TEXTURE_COMPARE_FUNC, GL_GREATER);
}
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
}
#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 +1533,8 @@ piglit_display(void)
}
end:
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
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 82bcf0780..88afe4efb 100644
--- a/tests/texturing/texwrap.c
+++ b/tests/texturing/texwrap.c
@@ -1146,7 +1146,8 @@ enum piglit_result piglit_display()
}
}
}
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
return pass ? PIGLIT_PASS : PIGLIT_FAIL;
}
@@ -1635,7 +1636,8 @@ static void init_texture(const struct format_desc *format, GLboolean npot)
baseformat, type, (void *) data);
break;
}
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
if (data != image) {
free(data);
@@ -1803,7 +1805,8 @@ outer_continue:;
default:;
}
- assert(glGetError() == 0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
if (!piglit_automatic) {
piglit_set_keyboard_func(key_func);