summaryrefslogtreecommitdiff
path: root/tests/general/object_purgeable-api-vbo.c
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2010-03-05 13:47:45 -0800
committerIan Romanick <ian.d.romanick@intel.com>2010-03-05 13:47:45 -0800
commit11c219002988e45f84d36fa66b4b8f30d83b192e (patch)
treeb991242a975bb146b1f7c33261386542441416a7 /tests/general/object_purgeable-api-vbo.c
parent96f011b3cd44c10d94a108ebde500b43c136f46f (diff)
object_purgeable: Refactor main test body into text_Purgeable
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Diffstat (limited to 'tests/general/object_purgeable-api-vbo.c')
-rw-r--r--tests/general/object_purgeable-api-vbo.c67
1 files changed, 10 insertions, 57 deletions
diff --git a/tests/general/object_purgeable-api-vbo.c b/tests/general/object_purgeable-api-vbo.c
index e300b9d0b..215ad6640 100644
--- a/tests/general/object_purgeable-api-vbo.c
+++ b/tests/general/object_purgeable-api-vbo.c
@@ -44,70 +44,23 @@ piglit_init(int argc, char **argv)
init_ObjectPurgeableAPI();
piglit_automatic = GL_TRUE;
- piglit_require_extension("GL_ARB_vertex_buffer_object");
+ piglit_require_extension("GL_ARB_vertex_buffer_object");
}
enum piglit_result
piglit_display(void)
{
- GLuint vbo;
- GLboolean pass = GL_TRUE;
+ GLuint vbo;
+ GLboolean pass;
- glGetError();
+ glGenBuffersARB(1, &vbo);
+ glBindBufferARB(GL_ARRAY_BUFFER_ARB, vbo);
+ glBufferDataARB(GL_ARRAY_BUFFER_ARB, 100*100, NULL, GL_STATIC_DRAW_ARB);
+ glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
- glGenBuffersARB(1, &vbo);
- glBindBufferARB(GL_ARRAY_BUFFER_ARB, vbo);
- glBufferDataARB(GL_ARRAY_BUFFER_ARB, 100*100, NULL, GL_STATIC_DRAW_ARB);
- glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
+ pass = test_Purgeable(vbo, GL_BUFFER_OBJECT_APPLE);
-
- if (test_GetObjectParameterivAPPLE(GL_BUFFER_OBJECT_APPLE, vbo, GL_FALSE) != GL_TRUE) {
- fprintf(stderr, "Default GL_PURGEABLE_APPLE state should GL_FALSE for texture object\n");
- pass = GL_FALSE;
- }
-
- if (test_ObjectpurgeableAPPLE(GL_BUFFER_OBJECT_APPLE, vbo, GL_VOLATILE_APPLE) != GL_TRUE) {
- fprintf(stderr, "Error when mark object %x to purgeable(GL_VOLATILE_APPLE)\n", vbo);
- pass = GL_FALSE;
- }
-
- if (test_GetObjectParameterivAPPLE(GL_BUFFER_OBJECT_APPLE, vbo, GL_TRUE) != GL_TRUE) {
- fprintf(stderr, "Object %x is not set to purgeable\n", vbo);
- pass = GL_FALSE;
- }
-
- if (test_ObjectunpurgeableAPPLE(GL_BUFFER_OBJECT_APPLE, vbo, GL_RETAINED_APPLE) != GL_TRUE) {
- fprintf(stderr, "Error when mark object %x to unpurgeable(GL_RETAINED_APPLE)\n", vbo);
- pass = GL_FALSE;
- }
-
- if (test_GetObjectParameterivAPPLE(GL_BUFFER_OBJECT_APPLE, vbo, GL_FALSE) != GL_TRUE) {
- fprintf(stderr, "Object %x is not set to unpurgeable\n", vbo);
- pass = GL_FALSE;
- }
-
- if (test_ObjectpurgeableAPPLE(GL_BUFFER_OBJECT_APPLE, vbo, GL_RELEASED_APPLE) != GL_TRUE) {
- fprintf(stderr, "Error when mark object %x to purgeable(GL_RELEASED_APPLE)\n", vbo);
- pass = GL_FALSE;
- }
-
- if (test_GetObjectParameterivAPPLE(GL_BUFFER_OBJECT_APPLE, vbo, GL_TRUE) != GL_TRUE) {
- fprintf(stderr, "Object %x is not set to purgeable\n", vbo);
- pass = GL_FALSE;
- }
-
- if (test_ObjectunpurgeableAPPLE(GL_BUFFER_OBJECT_APPLE, vbo, GL_UNDEFINED_APPLE) != GL_TRUE) {
- fprintf(stderr, "Error when mark object %x to unpurgeable(GL_UNDEFINED_APPLE)\n", vbo);
- pass = GL_FALSE;
- }
-
- if (test_GetObjectParameterivAPPLE(GL_BUFFER_OBJECT_APPLE, vbo, GL_FALSE) != GL_TRUE) {
- fprintf(stderr, "Object %x is not set to unpurgeable\n", vbo);
- pass = GL_FALSE;
- }
-
-
- glDeleteBuffersARB(1, &vbo);
- return pass ? PIGLIT_SUCCESS : PIGLIT_FAILURE;
+ glDeleteBuffersARB(1, &vbo);
+ return pass ? PIGLIT_SUCCESS : PIGLIT_FAILURE;
}