aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2013-01-14 09:31:18 -0800
committerEric Anholt <eric@anholt.net>2013-01-21 12:46:31 -0800
commit6d14fc960106d0ae54b8146d95a376319b2fd28f (patch)
treeee6fcd587905145886006bf6b360e35fd7e201c0
parentcff9108fb5bc95039c9a96c791f92d0941bfd454 (diff)
downloadpiglit-6d14fc960106d0ae54b8146d95a376319b2fd28f.tar.gz
fbo-storage-*: Use piglit_check_gl_error().
Reviewed-by: Carl Worth <cworth@cworth.org> Reviewed-by: Brian Paul <brianp@vmware.com>
-rw-r--r--tests/fbo/fbo-storage-completeness.c33
-rw-r--r--tests/fbo/fbo-storage-formats.c22
2 files changed, 18 insertions, 37 deletions
diff --git a/tests/fbo/fbo-storage-completeness.c b/tests/fbo/fbo-storage-completeness.c
index ef9a4bba..38426846 100644
--- a/tests/fbo/fbo-storage-completeness.c
+++ b/tests/fbo/fbo-storage-completeness.c
@@ -41,21 +41,6 @@ config.window_visual = PIGLIT_GL_VISUAL_RGB;
PIGLIT_GL_TEST_CONFIG_END
-static const char *TestName = "fbo-storage-formats";
-
-
-static void
-check_error(int line)
-{
- GLenum err = glGetError();
- if (err) {
- printf("%s: Unexpected error 0x%x at line %d\n",
- TestName, err, line);
- piglit_report_result(PIGLIT_FAIL);
- }
-}
-
-
#define EXT_packed_depth_stencil 1
#define ARB_framebuffer_object 2
#define ARB_texture_rg 3
@@ -160,17 +145,20 @@ test(void)
glGenFramebuffersEXT(1, &fbo);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbo);
- check_error(__LINE__);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
glGenRenderbuffersEXT(1, &rb);
- check_error(__LINE__);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, rb);
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT,
GL_COLOR_ATTACHMENT0,
GL_RENDERBUFFER_EXT,
rb);
- check_error(__LINE__);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, Formats[i].format,
piglit_width, piglit_height);
@@ -197,17 +185,20 @@ test(void)
glGenFramebuffersEXT(1, &fbo);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbo);
- check_error(__LINE__);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
glGenRenderbuffersEXT(1, &rb);
- check_error(__LINE__);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, rb);
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT,
GL_COLOR_ATTACHMENT0,
GL_RENDERBUFFER_EXT,
rb);
- check_error(__LINE__);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, Formats[complete].format,
piglit_width, piglit_height);
diff --git a/tests/fbo/fbo-storage-formats.c b/tests/fbo/fbo-storage-formats.c
index f9b5c410..5487a036 100644
--- a/tests/fbo/fbo-storage-formats.c
+++ b/tests/fbo/fbo-storage-formats.c
@@ -42,19 +42,6 @@ PIGLIT_GL_TEST_CONFIG_END
static const char *TestName = "fbo-storage-formats";
-
-static void
-check_error(int line)
-{
- GLenum err = glGetError();
- if (err) {
- printf("%s: Unexpected error 0x%x at line %d\n",
- TestName, err, line);
- piglit_report_result(PIGLIT_FAIL);
- }
-}
-
-
#define EXT_packed_depth_stencil 1
#define ARB_framebuffer_object 2
#define ARB_texture_rg 3
@@ -182,17 +169,20 @@ test(void)
glGenFramebuffersEXT(1, &fbo);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbo);
- check_error(__LINE__);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
glGenRenderbuffersEXT(1, &rb);
- check_error(__LINE__);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, rb);
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT,
GL_COLOR_ATTACHMENT0,
GL_RENDERBUFFER_EXT,
rb);
- check_error(__LINE__);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
/* clear out any errors */
while (glGetError())