summaryrefslogtreecommitdiff
path: root/tests/bugs
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2009-10-15 23:27:36 -0700
committerIan Romanick <ian.d.romanick@intel.com>2009-10-15 23:27:36 -0700
commit0d54218c237c1079a067c86949880163633097c1 (patch)
tree58ed05d4d87d6cc78569cb2422362a983e4c1cc9 /tests/bugs
parentd1cd7dd8fcb198a8c39b1cf80ac65de004aa8066 (diff)
fdo23670-*: Port both tests to framework
Diffstat (limited to 'tests/bugs')
-rw-r--r--tests/bugs/fdo23670-depth_test.c51
-rw-r--r--tests/bugs/fdo23670-drawpix_stencil.c53
2 files changed, 21 insertions, 83 deletions
diff --git a/tests/bugs/fdo23670-depth_test.c b/tests/bugs/fdo23670-depth_test.c
index 81923083d..63033f163 100644
--- a/tests/bugs/fdo23670-depth_test.c
+++ b/tests/bugs/fdo23670-depth_test.c
@@ -24,30 +24,30 @@
* Shuang he <shuang.he@intel.com>
*/
-
#include "piglit-util.h"
+int piglit_width = 100;
+int piglit_height = 100;
+int piglit_window_mode = GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH | GLUT_STENCIL;
-#define WIN_WIDTH 100
-#define WIN_HEIGHT 100
-
-static GLboolean Automatic = GL_FALSE;
-
-static void
-init(void)
+void
+piglit_init(int argc, char **argv)
{
+ /* Don't use piglit_ortho_projection! This uses a non-default
+ * depth range!
+ */
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
- glOrtho(0, WIN_WIDTH, 0, WIN_HEIGHT, 2, -2);
+ glOrtho(0, piglit_width, 0, piglit_height, 2, -2);
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
}
-static void
-display(void)
+enum piglit_result
+piglit_display(void)
{
static float white[] = {1.0, 1.0, 1.0, 0.0};
static float red[] = {1.0, 0.0, 0.0, 0.0};
@@ -76,32 +76,5 @@ display(void)
glutSwapBuffers();
- if (Automatic) {
- piglit_report_result(pass ? PIGLIT_SUCCESS : PIGLIT_FAILURE);
- }
-}
-
-int main(int argc, char **argv)
-{
- int i;
- for(i = 1; i < argc; ++i) {
- if (!strcmp(argv[i], "-auto"))
- Automatic = 1;
- else
- printf("Unknown option: %s\n", argv[i]);
- }
-
- glutInit(&argc, argv);
- glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH | GLUT_STENCIL);
- glutInitWindowSize(WIN_WIDTH, WIN_HEIGHT);
- glutCreateWindow("fdo23670-depth_test");
- glutKeyboardFunc(piglit_escape_exit_key);
- glutDisplayFunc(display);
-
- init();
-
- glutMainLoop();
-
- return 0;
-
+ return pass ? PIGLIT_SUCCESS : PIGLIT_FAILURE;
}
diff --git a/tests/bugs/fdo23670-drawpix_stencil.c b/tests/bugs/fdo23670-drawpix_stencil.c
index 8f9081029..cb92afc98 100644
--- a/tests/bugs/fdo23670-drawpix_stencil.c
+++ b/tests/bugs/fdo23670-drawpix_stencil.c
@@ -26,26 +26,18 @@
#include "piglit-util.h"
-#define WIN_WIDTH 100
-#define WIN_HEIGHT 100
+int piglit_width = 100;
+int piglit_height = 100;
+int piglit_window_mode = GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH | GLUT_STENCIL;
-static GLboolean Automatic = GL_FALSE;
-
-static void
-init(void)
+void
+piglit_init(int argc, char **argv)
{
- glMatrixMode(GL_PROJECTION);
- glPushMatrix();
- glLoadIdentity();
- glOrtho(0, WIN_WIDTH, 0, WIN_HEIGHT, -1, 1);
-
- glMatrixMode(GL_MODELVIEW);
- glPushMatrix();
- glLoadIdentity();
+ piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
}
-static void
-display(void)
+enum piglit_result
+piglit_display(void)
{
GLubyte stencil_rect[20 * 20];
int i;
@@ -87,32 +79,5 @@ display(void)
glutSwapBuffers();
- if (Automatic) {
- piglit_report_result(pass ? PIGLIT_SUCCESS : PIGLIT_FAILURE);
- }
-}
-
-int main(int argc, char **argv)
-{
- int i;
- for(i = 1; i < argc; ++i) {
- if (!strcmp(argv[i], "-auto"))
- Automatic = 1;
- else
- printf("Unknown option: %s\n", argv[i]);
- }
-
- glutInit(&argc, argv);
- glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH | GLUT_STENCIL);
- glutInitWindowSize(WIN_WIDTH, WIN_HEIGHT);
- glutCreateWindow("fdo23670-drawpix_stencil");
- glutKeyboardFunc(piglit_escape_exit_key);
- glutDisplayFunc(display);
-
- init();
-
- glutMainLoop();
-
- return 0;
-
+ return pass ? PIGLIT_SUCCESS : PIGLIT_FAILURE;
}