From c08f8c68c5cc09771497cf7d9c693eaee76085af Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Fri, 5 Mar 2010 15:12:06 -0800 Subject: object_purgeable: Check that setting redundant state generates an error Signed-off-by: Ian Romanick --- tests/general/object_purgeable.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/general/object_purgeable.c b/tests/general/object_purgeable.c index a9384f61..ad7bf1c0 100644 --- a/tests/general/object_purgeable.c +++ b/tests/general/object_purgeable.c @@ -42,6 +42,17 @@ PFNGLGETOBJECTPARAMETERIVAPPLEPROC pglGetObjectParameterivAPPLE = NULL; } \ } while (0) +#define EXPECT_AN_ERROR(string, expected) \ + do { \ + const GLenum err = glGetError(); \ + if (err != expected) { \ + fprintf(stderr, "%s generated error 0x%04x, " \ + "but error 0x%04x (%s) was expected\n", \ + string, err, expected, # expected); \ + pass = GL_FALSE; \ + } \ + } while (0) + void init_ObjectPurgeableAPI(void) { @@ -101,6 +112,9 @@ test_ObjectpurgeableAPPLE(GLenum objectType, GLuint name, GLenum option) pass = GL_FALSE; } + (void) (*pglObjectPurgeableAPPLE)(objectType, name, option); + EXPECT_AN_ERROR("glObjectPurgeableAPPLE", GL_INVALID_OPERATION); + return pass; } @@ -143,6 +157,9 @@ test_ObjectunpurgeableAPPLE(GLenum objectType, GLuint name, GLenum option) pass = GL_FALSE; } + (void) (*pglObjectUnpurgeableAPPLE)(objectType, name, option); + EXPECT_AN_ERROR("glObjectPurgeableAPPLE", GL_INVALID_OPERATION); + return pass; } -- cgit v1.2.3