Add more structure constructor tests.
[piglit/hramrach.git] / tests / glean / tvertprog1.h
blob429692f1970548e45a78031304d78a9df5dede3c
1 // BEGIN_COPYRIGHT -*- glean -*-
2 //
3 // Copyright (C) 1999 Allen Akin All Rights Reserved.
4 //
5 // Permission is hereby granted, free of charge, to any person
6 // obtaining a copy of this software and associated documentation
7 // files (the "Software"), to deal in the Software without
8 // restriction, including without limitation the rights to use,
9 // copy, modify, merge, publish, distribute, sublicense, and/or
10 // sell copies of the Software, and to permit persons to whom the
11 // Software is furnished to do so, subject to the following
12 // conditions:
13 //
14 // The above copyright notice and this permission notice shall be
15 // included in all copies or substantial portions of the
16 // Software.
17 //
18 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
19 // KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
20 // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
21 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ALLEN AKIN BE
22 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
23 // AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
24 // OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25 // DEALINGS IN THE SOFTWARE.
26 //
27 // END_COPYRIGHT
29 // tvertprog.h: Test GL_ARB_vertex_program extension.
30 // Brian Paul 22 October 2005
32 #ifndef __tvertprog_h__
33 #define __tvertprog_h__
35 #include "tmultitest.h"
37 namespace GLEAN {
39 #define windowSize 100
41 // to indicate a looser tolerance test is needed
42 #define FLAG_NONE 0
43 #define FLAG_LOOSE 1
45 class VertexProgram
47 public:
48 const char *name;
49 const char *progString;
50 GLfloat expectedColor[4];
51 GLfloat expectedZ;
52 int flags;
57 class VertexProgramTest: public MultiTest
59 public:
60 VertexProgramTest(const char* testName, const char* filter,
61 const char *extensions, const char* description):
62 MultiTest(testName, filter, extensions, description)
66 virtual void runOne(MultiTestResult &r, Window &w);
68 private:
69 GLfloat tolerance[5];
70 GLfloat looseTolerance[5];
71 void setup(void);
72 bool equalColors(const GLfloat a[4], const GLfloat b[4], int flags) const;
73 bool equalDepth(GLfloat z0, GLfloat z1) const;
74 bool testProgram(const VertexProgram &p);
75 void testBadProgram(MultiTestResult &result);
76 void reportFailure(const char *programName,
77 const GLfloat expectedColor[4],
78 const GLfloat actualColor[4] ) const;
79 void reportZFailure(const char *programName,
80 GLfloat expectedZ, GLfloat actualZ) const;
84 } // namespace GLEAN
86 #endif // __tvertprog_h__