summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2010-03-05 15:21:35 -0800
committerIan Romanick <ian.d.romanick@intel.com>2010-03-05 15:21:35 -0800
commit37f76708d644bfc7bb94bf507865a1a91b155e5b (patch)
tree8237821ac8c639f39814276fa72b763074f288e0
parentc08f8c68c5cc09771497cf7d9c693eaee76085af (diff)
object_purgeable: Check the operations on object 0 generate errors
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
-rw-r--r--tests/general/object_purgeable.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/general/object_purgeable.c b/tests/general/object_purgeable.c
index ad7bf1c06..eca72aaac 100644
--- a/tests/general/object_purgeable.c
+++ b/tests/general/object_purgeable.c
@@ -74,6 +74,39 @@ static const char expected_fmt[] =
"%s:%s: expected 0x%04x (%s), got 0x%04x\n";
+/**
+ * Check the setting and querying purgeability on object 0 generates errors.
+ */
+GLboolean
+test_DefaultObject(GLenum objectType)
+{
+ GLboolean pass = GL_TRUE;
+ GLint param;
+
+ /* From the GL_APPLE_object_purgeable spec:
+ *
+ * "INVALID_VALUE is generated if the <name> parameter of
+ * ObjectUnpurgeableAPPLE or ObjectUnpurgeableAPPLE is zero."
+ */
+ (void) (*pglObjectPurgeableAPPLE)(objectType, 0, GL_VOLATILE_APPLE);
+ EXPECT_AN_ERROR("glObjectPurgeableAPPLE", GL_INVALID_VALUE);
+
+ (void) (*pglObjectUnpurgeableAPPLE)(objectType, 0, GL_RETAINED_APPLE);
+ EXPECT_AN_ERROR("glObjectUnpurgeableAPPLE", GL_INVALID_VALUE);
+
+ /* From the GL_APPLE_object_purgeable spec:
+ *
+ * "INVALID_VALUE is generated if the <name> parameter of
+ * GetObjectParameterivAPPLE is zero."
+ */
+ (*pglGetObjectParameterivAPPLE)(objectType, 0, GL_PURGEABLE_APPLE,
+ &param);
+ EXPECT_AN_ERROR("glGetObjectParameterivAPPLE", GL_INVALID_VALUE);
+
+ return pass;
+}
+
+
GLboolean
test_ObjectpurgeableAPPLE(GLenum objectType, GLuint name, GLenum option)
{
@@ -192,6 +225,11 @@ GLboolean test_Purgeable(GLuint object, GLenum type)
glGetError();
+ if (!test_DefaultObject(type)) {
+ fprintf(stderr, "Default object tests failed.\n");
+ pass = GL_FALSE;
+ }
+
if (!test_GetObjectParameterivAPPLE(type, object, GL_FALSE)) {
fprintf(stderr, "Default state test failed.\n");
pass = GL_FALSE;