aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2013-01-14 09:46:10 -0800
committerEric Anholt <eric@anholt.net>2013-01-21 12:46:49 -0800
commitb06eff7c055bf148024345d288f6081afac2326e (patch)
treed6178af62b3fb6220ce70dd29da735b357dd5bf7
parent3dbe30d9758a85c4568b677e7785ab0d1dc1412c (diff)
downloadpiglit-b06eff7c055bf148024345d288f6081afac2326e.tar.gz
fbo-storage-formats: Report subtest results.
Reviewed-by: Carl Worth <cworth@cworth.org> Reviewed-by: Brian Paul <brianp@vmware.com>
-rw-r--r--tests/fbo/fbo-storage-formats.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/tests/fbo/fbo-storage-formats.c b/tests/fbo/fbo-storage-formats.c
index 3f16fbbf..3b82517d 100644
--- a/tests/fbo/fbo-storage-formats.c
+++ b/tests/fbo/fbo-storage-formats.c
@@ -40,8 +40,6 @@ config.window_visual = PIGLIT_GL_VISUAL_RGB;
PIGLIT_GL_TEST_CONFIG_END
-static const char *TestName = "fbo-storage-formats";
-
#define EXT_packed_depth_stencil 1
#define ARB_framebuffer_object 2
#define ARB_texture_rg 3
@@ -165,7 +163,6 @@ test(void)
GLuint fbo, rb;
int i;
GLboolean pass = GL_TRUE;
- GLenum err;
glGenFramebuffersEXT(1, &fbo);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbo);
@@ -190,35 +187,38 @@ test(void)
/* test formats that should be accepted */
for (i = 0; i < ARRAY_SIZE(formats); i++) {
+ const char *name = piglit_get_gl_enum_name(formats[i].format);
+
if (!have_extension[formats[i].extension])
continue;
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, formats[i].format,
piglit_width, piglit_height);
- err = glGetError();
- if (err) {
- printf("%s: glRenderbufferStorage failed for "
- "format 0x%x\n",
- TestName, formats[i].format);
+ if (!piglit_check_gl_error(GL_NO_ERROR)) {
+ piglit_report_subtest_result(PIGLIT_FAIL, name);
pass = GL_FALSE;
+ } else {
+ GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
+ piglit_report_subtest_result(PIGLIT_PASS,
+ "%s (%s)",
+ name,
+ (status == GL_FRAMEBUFFER_COMPLETE ?
+ "complete" : "incomplete"));
}
- printf("0x%04X: %s\n", formats[i].format,
- (glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT) ==
- GL_FRAMEBUFFER_COMPLETE_EXT ?
- "complete" : "incomplete"));
}
/* test formats that should fail */
for (i = 0; i < ARRAY_SIZE(invalid_formats); i++) {
+ const char *name = piglit_get_gl_enum_name(formats[i].format);
+
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT,
invalid_formats[i],
piglit_width, piglit_height);
- err = glGetError();
- if (err != GL_INVALID_ENUM) {
- printf("%s: glRenderbufferStorage erroneously "
- "accepted format 0x%x\n",
- TestName, invalid_formats[i]);
+ if (!piglit_check_gl_error(GL_INVALID_ENUM)) {
+ piglit_report_subtest_result(PIGLIT_FAIL, name);
pass = GL_FALSE;
+ } else {
+ piglit_report_subtest_result(PIGLIT_PASS, name);
}
}