Add more structure constructor tests.
[piglit/hramrach.git] / tests / glean / torthpos.h
blobf12f3137c71ebe6dbed0bfc04e34481349e85c42
1 // BEGIN_COPYRIGHT -*- glean -*-
2 //
3 // Copyright (C) 2000 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 // torthpos.h: Test positioning of primitives in orthographic projection.
30 // Apps that require precise 2D rasterization depend on these semantics.
32 #ifndef __torthpos_h__
33 #define __torthpos_h__
35 #include "tbase.h"
37 namespace GLEAN {
39 #define drawingSize 256
40 #define windowSize (drawingSize + 2)
42 // Auxiliary struct for holding a test result:
43 class OPResult: public BaseResult {
44 public:
45 bool pass; // not saved in results file
46 bool hasGaps; // true if gaps between prims were detected
47 bool hasOverlaps; // true if overlaps were detected
48 bool hasBadEdges; // true if edge-conditions were incorrect
50 OPResult() {
51 hasGaps = hasOverlaps = hasBadEdges = false;
53 void putresults(ostream& s) const {
54 s << hasGaps
55 << ' ' << hasOverlaps
56 << ' ' << hasBadEdges
57 << '\n';
59 bool getresults(istream& s) {
60 s >> hasGaps >> hasOverlaps >> hasBadEdges;
61 return s.good();
65 class OrthoPosPoints: public BaseTest<OPResult> {
66 public:
67 GLEAN_CLASS_WH(OrthoPosPoints, OPResult, windowSize, windowSize);
68 void logStats(OPResult& r);
69 }; // class OrthoPosPoints
71 class OrthoPosVLines: public BaseTest<OPResult> {
72 public:
73 GLEAN_CLASS_WH(OrthoPosVLines, OPResult, windowSize, windowSize);
74 void logStats(OPResult& r);
75 }; // class OrthoPosVLines
77 class OrthoPosHLines: public BaseTest<OPResult> {
78 public:
79 GLEAN_CLASS_WH(OrthoPosHLines, OPResult, windowSize, windowSize);
80 void logStats(OPResult& r);
81 }; // class OrthoPosHLines
83 class OrthoPosTinyQuads: public BaseTest<OPResult> {
84 public:
85 GLEAN_CLASS_WH(OrthoPosTinyQuads, OPResult, windowSize, windowSize);
86 void logStats(OPResult& r);
87 }; // class OrthoPosTinyQuads
89 class OrthoPosRandRects: public BaseTest<OPResult> {
90 public:
91 GLEAN_CLASS_WH(OrthoPosRandRects, OPResult, windowSize, windowSize);
92 void logStats(OPResult& r);
93 }; // class OrthoPosRandRects
95 class OrthoPosRandTris: public BaseTest<OPResult> {
96 public:
97 GLEAN_CLASS_WH(OrthoPosRandTris, OPResult, windowSize, windowSize);
98 void logStats(OPResult& r);
99 }; // class OrthoPosRandTris
101 } // namespace GLEAN
103 #endif // __torthpos_h__