aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVinson Lee <vlee@vmware.com>2010-11-26 19:53:55 -0800
committerVinson Lee <vlee@vmware.com>2010-11-26 19:53:55 -0800
commit82b519e6f53c65e80302d08a5df61808d8fc2ff7 (patch)
tree88315776f3d2616497acb27d09da629058085fce
parent09f5d25f8fcdc8f25254277b2bed1c887ad10ac2 (diff)
fdo31934: Convert to piglit test.
-rw-r--r--tests/bugs/CMakeLists.txt1
-rw-r--r--tests/bugs/fdo31934.c25
2 files changed, 20 insertions, 6 deletions
diff --git a/tests/bugs/CMakeLists.txt b/tests/bugs/CMakeLists.txt
index 70888c0a..67ca3583 100644
--- a/tests/bugs/CMakeLists.txt
+++ b/tests/bugs/CMakeLists.txt
@@ -40,4 +40,5 @@ add_executable (fdo23670-drawpix_stencil fdo23670-drawpix_stencil.c)
add_executable (fdo24066 fdo24066.c)
add_executable (fdo25614-genmipmap fdo25614-genmipmap.c)
add_executable (fdo28551 fdo28551.c)
+add_executable (fdo31934 fdo31934.c)
add_executable (tri-tex-crash tri-tex-crash.c)
diff --git a/tests/bugs/fdo31934.c b/tests/bugs/fdo31934.c
index 025c02df..0098f4cb 100644
--- a/tests/bugs/fdo31934.c
+++ b/tests/bugs/fdo31934.c
@@ -1,17 +1,27 @@
-#include <stdlib.h>
+#include "piglit-util.h"
-#define GL_GLEXT_PROTOTYPES
-#include <GL/gl.h>
-#include <GL/glut.h>
+static int Automatic = 0;
int main (int argc, char *argv[])
{
+ GLuint id;
+
glutInit(&argc, argv);
+ if (argc == 2 && !strcmp(argv[1], "-auto"))
+ Automatic = 1;
glutInitDisplayMode(GLUT_RGBA);
glutInitWindowSize(512,512);
- glutCreateWindow("");
+ glutCreateWindow("fdo31934");
+
+ glewInit();
+
+ if (!GLEW_VERSION_1_5) {
+ printf("Requires OpenGL 1.5\n");
+ piglit_report_result(PIGLIT_SKIP);
+ }
+
+ piglit_require_extension("GL_ARB_vertex_buffer_object");
- GLuint id;
glGenBuffersARB(1, &id);
glBindBufferARB(GL_ARRAY_BUFFER_ARB, id);
glBufferDataARB(GL_ARRAY_BUFFER_ARB, 0, NULL, GL_STATIC_DRAW);
@@ -21,5 +31,8 @@ int main (int argc, char *argv[])
glMapBuffer(GL_ARRAY_BUFFER_ARB, GL_READ_WRITE_ARB); /* CRASH! */
glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
+ if (Automatic)
+ printf("PIGLIT: {'result': 'pass' }\n");
+
return 0;
}