[Piglit] [PATCHv2] glean/tdepthstencil: Print what error was expected
Matt Turner
mattst88 at gmail.com
Wed Jan 30 11:04:19 PST 2013
... by using piglit_check_gl_error.
---
v2: Fix copy'n'paste error. Leave existing error messages in place.
tests/glean/tdepthstencil.cpp | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/tests/glean/tdepthstencil.cpp b/tests/glean/tdepthstencil.cpp
index 7de5d34..8b60b4f 100644
--- a/tests/glean/tdepthstencil.cpp
+++ b/tests/glean/tdepthstencil.cpp
@@ -36,6 +36,7 @@
#include "tdepthstencil.h"
#include "rand.h"
#include "image.h"
+#include "piglit-util-gl-common.h"
namespace GLEAN {
@@ -120,7 +121,7 @@ DepthStencilTest::testErrorDetection(void)
GLuint p[1];
glDrawPixels(1, 1, GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT, p);
- if (glGetError() != GL_INVALID_ENUM) {
+ if (!piglit_check_gl_error(GL_INVALID_ENUM)) {
sprintf(errorMsg,
"glDrawPixels(GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT)"
" failed to generate GL_INVALID_ENUM.");
@@ -128,7 +129,7 @@ DepthStencilTest::testErrorDetection(void)
}
glDrawPixels(1, 1, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT_24_8_EXT, p);
- if (glGetError() != GL_INVALID_OPERATION) {
+ if (!piglit_check_gl_error(GL_INVALID_OPERATION)) {
sprintf(errorMsg,
"glDrawPixels(GL_DEPTH_COMPONENT, GL_UNSIGNED_INT_24_8_EXT)"
" failed to generate GL_INVALID_OPERATION.");
@@ -136,7 +137,7 @@ DepthStencilTest::testErrorDetection(void)
}
glReadPixels(0, 0, 1, 1, GL_DEPTH_STENCIL_EXT, GL_FLOAT, p);
- if (glGetError() != GL_INVALID_ENUM) {
+ if (!piglit_check_gl_error(GL_INVALID_ENUM)) {
sprintf(errorMsg,
"glReadPixels(GL_DEPTH_STENCIL_EXT, GL_FLOAT)"
" failed to generate GL_INVALID_ENUM.");
@@ -144,7 +145,7 @@ DepthStencilTest::testErrorDetection(void)
}
glReadPixels(0, 0, 1, 1, GL_STENCIL_INDEX, GL_UNSIGNED_INT_24_8_EXT, p);
- if (glGetError() != GL_INVALID_OPERATION) {
+ if (!piglit_check_gl_error(GL_INVALID_OPERATION)) {
sprintf(errorMsg,
"glReadPixels(GL_STENCIL_INDEX, GL_UNSIGNED_INT_24_8_EXT)"
" failed to generate GL_INVALID_OPERATION.");
--
1.7.8.6
More information about the Piglit
mailing list