summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2015-09-22 19:47:02 -0700
committerIan Romanick <ian.d.romanick@intel.com>2016-01-20 16:49:48 -0800
commit298fe2c167fe0d32e87cd5f1d24712f481bf8f7b (patch)
tree8f0055e9fe52fc65f6eb1e5af53dc25206c5aa44
parent7f5a2b7808e250429d010826c0f71ab0aa60c4a9 (diff)
primitive-restart: Replace assert(glGetError()==0)
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Vinson Lee <vlee@freedesktop.org>
-rw-r--r--tests/general/primitive-restart.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/general/primitive-restart.c b/tests/general/primitive-restart.c
index 53f4349ab..5cd8be3d2 100644
--- a/tests/general/primitive-restart.c
+++ b/tests/general/primitive-restart.c
@@ -294,7 +294,7 @@ test_draw_by_index(VBO_CFG vbo_cfg, bool one_by_one, GLenum primMode, GLenum ind
GLfloat x, dx;
GLuint restart_index;
GLuint num_elems;
- bool pass;
+ bool pass = true;
const char *typeStr = NULL, *primStr = NULL;
GLuint vbo1, vbo2;
bool create_vbo1 = false;
@@ -438,8 +438,8 @@ test_draw_by_index(VBO_CFG vbo_cfg, bool one_by_one, GLenum primMode, GLenum ind
}
glEnableClientState(GL_VERTEX_ARRAY);
+ pass = piglit_check_gl_error(GL_NO_ERROR) && pass;
- assert(glGetError()==0);
enable_restart(restart_index);
/* Draw */
@@ -466,13 +466,13 @@ test_draw_by_index(VBO_CFG vbo_cfg, bool one_by_one, GLenum primMode, GLenum ind
glDeleteBuffers(1, &vbo2);
}
- pass = check_rendering();
- if (!pass) {
+ if (!check_rendering()) {
fprintf(stderr, "%s: failure drawing with %s(%s, %s), %s\n",
TestName,
one_by_one ? "glArrayElement" : "glDrawElements",
primStr, typeStr,
vbo_cfg_names[vbo_cfg]);
+ pass = false;
}
piglit_present_results();
@@ -550,8 +550,8 @@ test_draw_arrays(VBO_CFG vbo_cfg)
}
glEnableClientState(GL_VERTEX_ARRAY);
-
- assert(glGetError()==0);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ return false;
/*
* Render and do checks.