Add more structure constructor tests.
[piglit/hramrach.git] / tests / glean / tvertattrib.h
blob1eb4b6ebb20258ceb40d0a4979acdbc8c9f0736e
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
30 #ifndef __tvertattrib_h__
31 #define __tvertattrib_h__
33 #include "tbase.h"
35 // Avoid name collision on Windows
36 #undef OPTIONAL
38 namespace GLEAN {
41 class VertAttribResult: public BaseResult
43 public:
44 bool pass;
45 int numNVtested, numARBtested, num20tested;
47 VertAttribResult()
49 numNVtested = numARBtested = num20tested = 0;
52 virtual void putresults(ostream& s) const
54 s << pass
55 << ' ' << numNVtested
56 << ' ' << numARBtested
57 << ' ' << num20tested
58 << '\n';
61 virtual bool getresults(istream& s)
63 s >> pass >> numNVtested >> numARBtested >> num20tested;
64 return s.good();
69 class VertAttribTest: public BaseTest<VertAttribResult>
71 public:
72 GLEAN_CLASS(VertAttribTest, VertAttribResult);
73 virtual void logStats(VertAttribResult& r);
75 private:
76 enum Aliasing {
77 REQUIRED,
78 DISALLOWED,
79 OPTIONAL
82 void FailMessage(VertAttribResult &r, const char *msg,
83 const char *ext, int dlistMode) const;
84 bool TestAttribs(VertAttribResult &r,
85 int attribFunc,
86 PFNGLGETVERTEXATTRIBFVARBPROC getAttribfv,
87 Aliasing aliasing,
88 int numAttribs);
89 bool TestNVfuncs(VertAttribResult &r);
90 bool TestARBfuncs(VertAttribResult &r, bool shader);
91 bool Test20funcs(VertAttribResult &r);
94 } // namespace GLEAN
96 #endif // __tvertattrib_h__