summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2010-03-05 15:12:06 -0800
committerIan Romanick <ian.d.romanick@intel.com>2010-03-05 15:12:06 -0800
commitc08f8c68c5cc09771497cf7d9c693eaee76085af (patch)
treeeb44259d54982a35e1cf810b70715f4837a9b273
parent67a663584fe3f3075c52e107cc42ffdbbbc1a613 (diff)
object_purgeable: Check that setting redundant state generates an error
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
-rw-r--r--tests/general/object_purgeable.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/general/object_purgeable.c b/tests/general/object_purgeable.c
index a9384f611..ad7bf1c06 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;
}