Add more structure constructor tests.
[piglit/hramrach.git] / tests / glean / tfpexceptions.h
blobfee9a0c679f3d5843e48718bc33e61ed6b004fd9
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 // tfpexceptions.h: Test for floating point exceptions caused by
30 // infinity, Nan, denormalized numbers, divide by zero, etc.
31 // Brian Paul 9 November 2005
33 #ifndef __tfpexceptions_h__
34 #define __tfpexceptions_h__
36 #include "tmultitest.h"
38 namespace GLEAN {
41 #define windowSize 100
44 class FPExceptionsTest: public MultiTest
46 public:
47 FPExceptionsTest(const char* testName, const char* filter,
48 const char *extensions, const char* description)
49 : MultiTest(testName, filter, extensions, description)
53 virtual void runOne(MultiTestResult &r, Window &w);
55 private:
56 enum Mode {
57 MODE_INFINITY,
58 MODE_NAN,
59 MODE_DIVZERO,
60 MODE_DENORM,
61 MODE_OVERFLOW
64 void enableExceptions(bool enable);
66 bool testVertices(Mode m);
67 bool testTransformation(Mode m);
68 bool testClipping(Mode m);
69 bool testOverflow(void);
71 void reportPassFail(MultiTestResult &r, bool pass, const char *msg) const;
72 void setup(void);
76 } // namespace GLEAN
78 #endif // __tfpexceptions_h__