[Piglit] [PATCH 3/3] glean/maskedclear: remove (replaced by new piglit test)

Brian Paul brianp at vmware.com
Tue Jan 22 07:39:51 PST 2013


---
 tests/all.tests               |    1 -
 tests/glean/CMakeLists.gl.txt |    1 -
 tests/glean/tmaskedclear.cpp  |  264 -----------------------------------------
 tests/glean/tmaskedclear.h    |   62 ----------
 4 files changed, 0 insertions(+), 328 deletions(-)
 delete mode 100644 tests/glean/tmaskedclear.cpp
 delete mode 100644 tests/glean/tmaskedclear.h

diff --git a/tests/all.tests b/tests/all.tests
index 38d428d..012abff 100644
--- a/tests/all.tests
+++ b/tests/all.tests
@@ -96,7 +96,6 @@ glean['fbo'] = GleanTest('fbo')
 glean['fpexceptions'] = GleanTest('fpexceptions')
 glean['getString'] = GleanTest('getString')
 glean['logicOp'] = GleanTest('logicOp')
-glean['maskedClear'] = GleanTest('maskedClear')
 glean['occluquery'] = GleanTest('occluQry')
 glean['orthoPosRandTris'] = GleanTest('orthoPosRandTris')
 glean['orthoPosRandRects'] = GleanTest('orthoPosRandRects')
diff --git a/tests/glean/CMakeLists.gl.txt b/tests/glean/CMakeLists.gl.txt
index 7ef98dc..5e20e55 100644
--- a/tests/glean/CMakeLists.gl.txt
+++ b/tests/glean/CMakeLists.gl.txt
@@ -39,7 +39,6 @@ piglit_add_executable (glean
 	tgetstr.cpp
 	tglsl1.cpp
 	tlogicop.cpp
-	tmaskedclear.cpp
 	tmultitest.cpp
 	toccluqry.cpp
 	torthpos.cpp
diff --git a/tests/glean/tmaskedclear.cpp b/tests/glean/tmaskedclear.cpp
deleted file mode 100644
index a3fa723..0000000
--- a/tests/glean/tmaskedclear.cpp
+++ /dev/null
@@ -1,264 +0,0 @@
-// BEGIN_COPYRIGHT -*- glean -*-
-// 
-// Copyright (C) 1999  Allen Akin   All Rights Reserved.
-// 
-// Permission is hereby granted, free of charge, to any person
-// obtaining a copy of this software and associated documentation
-// files (the "Software"), to deal in the Software without
-// restriction, including without limitation the rights to use,
-// copy, modify, merge, publish, distribute, sublicense, and/or
-// sell copies of the Software, and to permit persons to whom the
-// Software is furnished to do so, subject to the following
-// conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the
-// Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
-// KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
-// WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
-// PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL ALLEN AKIN BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-// AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-// OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-// DEALINGS IN THE SOFTWARE.
-// 
-// END_COPYRIGHT
-
-// tmaskedclear.cpp:  Test color/index masking with glClear.
-
-#include "tmaskedclear.h"
-
-namespace GLEAN {
-
-void
-MaskedClearTest::failRGB(BasicResult &r, GLint chan, GLfloat expected,
-			 GLfloat actual, GLint buffer)
-{
-	static const char *chanNames[] = { "Red", "Green", "Blue", "Alpha" };
-	static const char *bufferNames[] = { "GL_FRONT", "GL_BACK" };
-	GLboolean mask[4];
-	glGetBooleanv(GL_COLOR_WRITEMASK, mask);
-	env->log << name << ":  FAIL "
-		 << r.config->conciseDescription() << '\n'
-		 << "\t" << chanNames[chan] << " is " << actual
-		 << ", expected " << expected
-		 << " in " << bufferNames[buffer] << " buffer\n";
-	env->log << "\tGL_COLOR_WRITEMASK = ("
-		 << (mask[0] ? "GL_TRUE" : "GL_FALSE") << ", "
-		 << (mask[1] ? "GL_TRUE" : "GL_FALSE") << ", "
-		 << (mask[2] ? "GL_TRUE" : "GL_FALSE") << ", "
-		 << (mask[3] ? "GL_TRUE" : "GL_FALSE") << ")\n";
-}
-
-void
-MaskedClearTest::failCI(BasicResult& r, GLuint expected, GLuint actual,
-			GLint buffer)
-{
-	static const char *bufferNames[] = { "GL_FRONT", "GL_BACK" };
-	GLint mask;
-	glGetIntegerv(GL_INDEX_WRITEMASK, &mask);
-	env->log << name << ":  FAIL "
-		 << r.config->conciseDescription() << '\n'
-		 << "\tcolor index is " << actual
-		 << ", expected " << expected
-		 << " in " << bufferNames[buffer] << " buffer\n";
-	env->log << "\tGL_INDEX_WRITEMASK = " << mask << "\n";
-}
-
-void
-MaskedClearTest::failZ(BasicResult& r, GLfloat expected, GLfloat actual)
-{
-	GLboolean mask;
-	glGetBooleanv(GL_DEPTH_WRITEMASK, &mask);
-	env->log << name << ":  FAIL "
-		 << r.config->conciseDescription() << '\n'
-		 << "\tdepth buffer value is " << actual
-		 << ", expected " << expected << "\n";
-	env->log << "\tGL_DEPTH_WRITEMASK = "
-		 << (mask ? "GL_TRUE" : "GL_FALSE") << "\n";
-}
-
-void
-MaskedClearTest::failStencil(BasicResult& r, GLuint expected, GLuint actual)
-{
-	GLint mask;
-	glGetIntegerv(GL_STENCIL_WRITEMASK, &mask);
-	env->log << name << ":  FAIL "
-		 << r.config->conciseDescription() << '\n'
-		 << "\tstencil buffer value is " << actual
-		 << ", expected " << expected << "\n";
-	env->log << "\tGL_STENCIL_WRITEMASK = " << mask << "\n";
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// runOne:  Run a single test case
-///////////////////////////////////////////////////////////////////////////////
-void
-MaskedClearTest::runOne(BasicResult& r, Window&) {
-
-	bool passed = true;
-
-	// GL init, just to be safe
-	glDisable(GL_SCISSOR_TEST);
-
-	// only test front/back-left buffers, quad-buffer stereo in the future
-	const GLint numBuffers = r.config->db ? 2 : 1;
-	for (GLint buffer = 0; buffer < numBuffers && passed; buffer++) {
-
-		if (buffer == 0) {
-			glReadBuffer(GL_FRONT);
-			glDrawBuffer(GL_FRONT);
-		} else {
-			glReadBuffer(GL_BACK);
-			glDrawBuffer(GL_BACK);
-		}
-
-		if (r.config->canRGBA) {
-			const GLint numChannels = (r.config->a > 0) ? 4 : 3;
-			for (GLint chan = 0;
-			    chan < numChannels && passed; chan++) {
-				// clear to black
-				glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
-				glClearColor(0.0, 0.0, 0.0, 0.0);
-				glClear(GL_COLOR_BUFFER_BIT);
-
-				// select one channel to "clear" to 1.0
-				glColorMask(chan == 0, chan == 1,
-					    chan == 2, chan == 3);
-
-				// try to clear surface to white
-				glClearColor(1.0, 1.0, 1.0, 1.0);
-				glClear(GL_COLOR_BUFFER_BIT);
-
-				// read 1x1 image at (x,y)=(4,4)
-				GLfloat pixel[4];
-				glReadPixels(4, 4, 1, 1,
-				    GL_RGBA, GL_FLOAT, pixel);
-
-				// test results
-				for (GLint comp = 0;
-				    comp < numChannels && passed; comp++) {
-					if (comp == chan) {
-						// component should be 1.0
-						if (pixel[comp] < 0.5) {
-							passed = false;
-							failRGB(r, comp, 1.0,
-							  pixel[comp], buffer);
-						}
-					} else {
-						// component should be 0.0
-						if (pixel[comp] > 0.5) {
-							passed = false;
-							failRGB(r, comp, 0.0,
-							  pixel[comp], buffer);
-						}
-					}
-				}
-			}
-		}
-		else {
-			const GLint indexBits = r.config->bufSize;
-			// We just run <indexBits> tests rather than 2^indexBits
-			for (GLint bit = 0; bit < indexBits && passed; bit++) {
-				// clear to 0
-				glIndexMask(~0);
-				glClearIndex(0);
-				glClear(GL_COLOR_BUFFER_BIT);
-
-				// select one bit to "clear" to 1
-				glIndexMask(1 << bit);
-
-				// try to clear surface to ~0
-				glClearIndex(~0);
-				glClear(GL_COLOR_BUFFER_BIT);
-
-				// read 1x1 image at (x,y)=(4,4)
-				GLuint pixel;
-				glReadPixels(4, 4, 1, 1,
-				    GL_COLOR_INDEX, GL_UNSIGNED_INT, &pixel);
-
-				// test results
-				if (pixel != (1U << bit)) {
-					passed = false;
-					failCI(r, 1 << bit, pixel, buffer);
-				}
-			}
-		}
-	}
-
-	if (passed && r.config->z > 0) {
-		// clear depth buffer to zero
-		glDepthMask(GL_TRUE);
-		glClearDepth(0.0);
-		glClear(GL_DEPTH_BUFFER_BIT);
-
-		// disable Z writes, try to clear to one
-		glDepthMask(GL_FALSE);
-		glClearDepth(1.0);
-		glClear(GL_DEPTH_BUFFER_BIT);
-
-		// read 1x1 image at (x,y)=(4,4);
-		GLfloat depth;
-		glReadPixels(4, 4, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &depth);
-
-		// test result
-		if (depth != 0.0) {
-			passed = false;
-			failZ(r, 0.0, depth);
-		}
-	}
-
-	if (passed && r.config->s > 0) {
-		const GLint stencilBits = r.config->s;
-		// We just run <stencilBits> tests rather than 2^stencilBits
-		for (GLint bit = 0; bit < stencilBits && passed; bit++) {
-			// clear to 0
-			glStencilMask(~0);
-			glClearStencil(0);
-			glClear(GL_STENCIL_BUFFER_BIT);
-
-			// select one bit to "clear" to 1
-			glStencilMask(1 << bit);
-
-			// try to clear stencil buffer to ~0
-			glClearStencil(~0);
-			glClear(GL_STENCIL_BUFFER_BIT);
-
-			// read 1x1 image at (x,y)=(4,4)
-			GLuint stencil;
-			glReadPixels(4, 4, 1, 1,
-			    GL_STENCIL_INDEX, GL_UNSIGNED_INT, &stencil);
-
-			// test results
-			if (stencil != (1U << bit)) {
-				passed = false;
-				failStencil(r, 1 << bit, stencil);
-			}
-		}
-	}
-	r.pass = passed;
-} // MaskedClearTest::runOne
-
-
-///////////////////////////////////////////////////////////////////////////////
-// logOne:  Log a single test case
-///////////////////////////////////////////////////////////////////////////////
-void
-MaskedClearTest::logOne(BasicResult& r) {
-	if (r.pass) {
-		logPassFail(r);
-		logConcise(r);
-	}
-} // MaskedClearTest::logOne
-
-///////////////////////////////////////////////////////////////////////////////
-// The test object itself:
-///////////////////////////////////////////////////////////////////////////////
-MaskedClearTest maskedClearTest("maskedClear", "window",
-	"This test checks that glClear works correctly with glColorMask,\n"
-	"glIndexMask, glDepthMask and glStencilMask.\n");
-
-
-} // namespace GLEAN
diff --git a/tests/glean/tmaskedclear.h b/tests/glean/tmaskedclear.h
deleted file mode 100644
index d03fd15..0000000
--- a/tests/glean/tmaskedclear.h
+++ /dev/null
@@ -1,62 +0,0 @@
-// BEGIN_COPYRIGHT -*- glean -*-
-// 
-// Copyright (C) 1999  Allen Akin   All Rights Reserved.
-// 
-// Permission is hereby granted, free of charge, to any person
-// obtaining a copy of this software and associated documentation
-// files (the "Software"), to deal in the Software without
-// restriction, including without limitation the rights to use,
-// copy, modify, merge, publish, distribute, sublicense, and/or
-// sell copies of the Software, and to permit persons to whom the
-// Software is furnished to do so, subject to the following
-// conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the
-// Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
-// KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
-// WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
-// PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL ALLEN AKIN BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-// AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-// OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-// DEALINGS IN THE SOFTWARE.
-// 
-// END_COPYRIGHT
-
-// tmaskedclear.h:  Test clearing of colorbuffers with glColorMask or
-// glIndexMask.
-// Author: Brian Paul (brianp at valinux.com)  September 2000
-
-
-#ifndef __tmaskedclear_h__
-#define __tmaskedclear_h__
-
-#include "tbasic.h"
-
-namespace GLEAN {
-
-class MaskedClearTest: public BasicTest {
-    public:
-	MaskedClearTest(const char* testName, const char* filter,
-			const char* description):
-		BasicTest(testName, filter, description) {
-	}
-
-	virtual void runOne(BasicResult& r, Window& w);
-	virtual void logOne(BasicResult& r);
-
-    private:
-	void failRGB(BasicResult& r, GLint chan, GLfloat expected,
-		     GLfloat actual, GLint buffer);
-	void failCI(BasicResult& r, GLuint expected, GLuint actual,
-		    GLint buffer);
-	void failZ(BasicResult& r, GLfloat expected, GLfloat actual);
-	void failStencil(BasicResult& r, GLuint expected, GLuint actual);
-}; // class MaskedClearTest
-
-} // namespace GLEAN
-
-#endif // __tmaskedclear_h__
-- 
1.7.3.4



More information about the Piglit mailing list