[Piglit] [PATCH] push-pop-texture-state: a replacement for the fdo9833 test

Brian Paul brianp at vmware.com
Wed Nov 7 07:23:57 PST 2012


This updates and renames the fdo9833.c test.
---
 tests/all.tests                        |    2 +-
 tests/bugs/CMakeLists.gl.txt           |    1 -
 tests/bugs/fdo9833.c                   |   47 --------------------------------
 tests/general/CMakeLists.gl.txt        |    1 +
 tests/general/push-pop-texture-state.c |   39 ++++++++++++++++++++++++++
 5 files changed, 41 insertions(+), 49 deletions(-)
 delete mode 100644 tests/bugs/fdo9833.c
 create mode 100644 tests/general/push-pop-texture-state.c

diff --git a/tests/all.tests b/tests/all.tests
index 09b0931..4c34e68 100644
--- a/tests/all.tests
+++ b/tests/all.tests
@@ -482,7 +482,6 @@ add_texwrap_format_tests(gl11)
 gl11['copyteximage 1D'] = PlainExecTest(['copyteximage', '-auto', '1D'])
 gl11['copyteximage 2D'] = PlainExecTest(['copyteximage', '-auto', '2D'])
 add_plain_test(gl11, 'drawbuffer-modes')
-add_plain_test(gl11, 'fdo9833')
 add_plain_test(gl11, 'fdo10370')
 add_plain_test(gl11, 'fdo23489')
 add_plain_test(gl11, 'fdo23670-depth_test')
@@ -518,6 +517,7 @@ add_plain_test(gl11, 'linestipple')
 add_plain_test(gl11, 'longprim')
 add_plain_test(gl11, 'point-line-no-cull')
 add_plain_test(gl11, 'polygon-mode')
+add_concurrent_test(gl11, 'push-pop-texture-state')
 add_concurrent_test(gl11, 'quad-invariance')
 add_plain_test(gl11, 'read-front')
 add_concurrent_test(gl11, 'readpix-z')
diff --git a/tests/bugs/CMakeLists.gl.txt b/tests/bugs/CMakeLists.gl.txt
index c77848a..e24ec6b 100644
--- a/tests/bugs/CMakeLists.gl.txt
+++ b/tests/bugs/CMakeLists.gl.txt
@@ -14,7 +14,6 @@ link_libraries (
 piglit_add_executable (crash-cubemap-order crash-cubemap-order.c)
 piglit_add_executable (crash-texparameter-before-teximage crash-texparameter-before-teximage.c)
 piglit_add_executable (drawbuffer-modes drawbuffer-modes.c)
-piglit_add_executable (fdo9833 fdo9833.c)
 piglit_add_executable (fdo10370 fdo10370.c)
 piglit_add_executable (fdo14575 fdo14575.c)
 piglit_add_executable (r300-readcache r300-readcache.c)
diff --git a/tests/bugs/fdo9833.c b/tests/bugs/fdo9833.c
deleted file mode 100644
index 37c66c0..0000000
--- a/tests/bugs/fdo9833.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
- * Test case from fd.o bug #9833.
- * https://bugs.freedesktop.org/show_bug.cgi?id=9833
- */
-
-#include "piglit-util-gl-common.h"
-
-PIGLIT_GL_TEST_CONFIG_BEGIN
-
-	config.supports_gl_compat_version = 10;
-
-	config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA;
-
-PIGLIT_GL_TEST_CONFIG_END
-
-enum piglit_result
-piglit_display(void)
-{
-	static int goterrors = 0;
-	static int frame = 0;
-	GLuint error;
-
-	frame++;
-	glClear(GL_COLOR_BUFFER_BIT);
-
-	glPushAttrib(GL_TEXTURE_BIT);
-	while ( (error = glGetError()) != GL_NO_ERROR) {
-		fprintf(stderr, "OpenGL error 0x%0x occured after glPushAttrib!\n", error);
-		goterrors++;
-	}
-
-
-	glPopAttrib();
-	while ( (error = glGetError()) != GL_NO_ERROR) {
-		fprintf(stderr, "OpenGL error 0x%0x occured after glPopAttrib!\n", error);
-		goterrors++;
-	}
-
-	piglit_present_results();
-
-	return goterrors ? PIGLIT_FAIL : PIGLIT_PASS;
-}
-
-void
-piglit_init(int argc, char **argv)
-{
-}
diff --git a/tests/general/CMakeLists.gl.txt b/tests/general/CMakeLists.gl.txt
index 171b3f1..2a9bf8b 100644
--- a/tests/general/CMakeLists.gl.txt
+++ b/tests/general/CMakeLists.gl.txt
@@ -90,6 +90,7 @@ piglit_add_executable (point-line-no-cull point-line-no-cull.c)
 piglit_add_executable (polygon-mode polygon-mode.c)
 piglit_add_executable (primitive-restart primitive-restart.c)
 piglit_add_executable (provoking-vertex provoking-vertex.c)
+piglit_add_executable (push-pop-texture-state push-pop-texture-state.c)
 piglit_add_executable (oes-read-format oes-read-format.c)
 piglit_add_executable (read-front read-front.c)
 piglit_add_executable (readpix-z readpix-z.c)
diff --git a/tests/general/push-pop-texture-state.c b/tests/general/push-pop-texture-state.c
new file mode 100644
index 0000000..73b3156
--- /dev/null
+++ b/tests/general/push-pop-texture-state.c
@@ -0,0 +1,39 @@
+/**
+ * Test pushing/popping of GL_TEXTURE_BIT state.
+ *
+ * Test case from fd.o bug #9833.
+ * https://bugs.freedesktop.org/show_bug.cgi?id=9833
+ */
+
+#include "piglit-util-gl-common.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+	config.supports_gl_compat_version = 10;
+
+	config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+enum piglit_result
+piglit_display(void)
+{
+	bool pass = true;
+
+	glClear(GL_COLOR_BUFFER_BIT);
+
+	glPushAttrib(GL_TEXTURE_BIT);
+	pass = piglit_check_gl_error(GL_NO_ERROR) && pass;
+
+	glPopAttrib();
+	pass = piglit_check_gl_error(GL_NO_ERROR) && pass;
+
+	piglit_present_results();
+
+	return pass ? PIGLIT_PASS : PIGLIT_FAIL;
+}
+
+void
+piglit_init(int argc, char **argv)
+{
+}
-- 
1.7.3.4



More information about the Piglit mailing list