diff options
author | Brian Paul <brianp@vmware.com> | 2014-09-24 10:41:18 -0600 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2014-09-26 07:17:00 -0600 |
commit | e83517216470471146b0baff33880ff99b5830d2 (patch) | |
tree | 450f36d09a6841a0b91b518308ced3f75672c1e3 /tests | |
parent | f4f457e4bb88e1956faa621ec74f1a04879fc6df (diff) |
draw-pixels: report format/type for failures
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/general/draw-pixels.c | 56 |
1 files changed, 40 insertions, 16 deletions
diff --git a/tests/general/draw-pixels.c b/tests/general/draw-pixels.c index 46bacfaa6..27b16755a 100644 --- a/tests/general/draw-pixels.c +++ b/tests/general/draw-pixels.c @@ -708,13 +708,21 @@ computeExpected(GLenum format, GLenum type, GLuint index, } } +static void +report_failure(GLenum format, GLenum type) +{ + printf(" Failed with format %s, type %s\n", + piglit_get_gl_enum_name(format), + piglit_get_gl_enum_name(type)); +} + enum piglit_result piglit_display(void) { int i, j, k; GLenum format, type; GLvoid *pixels = NULL; - GLboolean pass = true; + bool pass = true, p; GLfloat black[4] = {0.0, 0.0, 0.0, 1.0}; GLfloat red[4] = {1.0, 0.0, 0.0, 1.0}; @@ -784,10 +792,13 @@ piglit_display(void) pass = piglit_check_gl_error(GL_NO_ERROR) && pass; - pass = piglit_probe_rect_rgba(0, 0, + p = piglit_probe_rect_rgba(0, 0, piglit_width, piglit_height, - expected[j]) - && pass; + expected[j]); + if (!p) { + report_failure(format, type); + pass = GL_FALSE; + } break; case GL_DEPTH_COMPONENT: @@ -800,10 +811,13 @@ piglit_display(void) pass = piglit_check_gl_error(GL_NO_ERROR) && pass; - pass = piglit_probe_rect_depth(0, 0, + p = piglit_probe_rect_depth(0, 0, piglit_width, piglit_height, - expected[j][0]) - && pass; + expected[j][0]); + if (!p) { + report_failure(format, type); + pass = GL_FALSE; + } glDisable(GL_DEPTH_TEST); break; @@ -816,11 +830,14 @@ piglit_display(void) pass = piglit_check_gl_error(GL_NO_ERROR) && pass; /* Probe stencil buffer */ - pass = piglit_probe_rect_stencil(0, 0, + p = piglit_probe_rect_stencil(0, 0, piglit_width, piglit_height, - expected[j][0]) - && pass; + expected[j][0]); + if (!p) { + report_failure(format, type); + pass = GL_FALSE; + } glEnable(GL_STENCIL_TEST); glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP); @@ -832,18 +849,25 @@ piglit_display(void) /* Probe color buffer. Color buffer will * stay unaffected by piglit_draw_rect() */ - pass = piglit_probe_rect_rgba(0, 0, + p = piglit_probe_rect_rgba(0, 0, piglit_width, piglit_height, - black) - && pass; + black); + if (!p) { + report_failure(format, type); + pass = GL_FALSE; + } glStencilFunc(GL_EQUAL, expected[j][0], ~0); piglit_draw_rect(0, 0, piglit_width, piglit_height); - pass = piglit_probe_rect_rgba(0, 0, + p = piglit_probe_rect_rgba(0, 0, piglit_width, piglit_height, - red) - && pass; + red); + if (!p) { + report_failure(format, type); + pass = GL_FALSE; + } + glDisable(GL_STENCIL_TEST); break; } |