1 #ifndef _ESEXTCTEXTUREBORDERCLAMPTEXPARAMETERIERRORS_HPP
2 #define _ESEXTCTEXTUREBORDERCLAMPTEXPARAMETERIERRORS_HPP
3 /*-------------------------------------------------------------------------
4  * OpenGL Conformance Test Suite
5  * -----------------------------
6  *
7  * Copyright (c) 2014-2016 The Khronos Group Inc.
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  *      http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  *
21  */ /*!
22  * \file
23  * \brief
24  */ /*-------------------------------------------------------------------*/
25 
26 /*!
27  * \file esextcTextureBorderClampTexParameterIErrors.hpp
28  * \brief Texture Border Clamp glTexParameterIivEXT(), glTexParameterIuivEXT() Errors (Test 2)
29  */ /*-------------------------------------------------------------------*/
30 
31 #include "esextcTextureBorderClampBase.hpp"
32 
33 namespace glcts
34 {
35 /**  Implementation of Test 2 from CTS_EXT_texture_border_clamp. Description follows
36  *
37  *    Verify glTexParameterIivEXT(), glTexParameterIuivEXT() report errors as per
38  *    spec.
39  *
40  *    Category: Negative tests,
41  *              Optional dependency on EXT_texture_buffer;
42  *              Optional dependency on EXT_texture_cube_map_array;
43  *              Optional dependency on OES_texture_storage_multisample_2d_array.
44  *    Priority: Must-have.
45  *
46  *    Make sure that the functions report GL_INVALID_ENUM error if cube-map
47  *    face or GL_TEXTURE_BUFFER_EXT texture targets (if supported) is issued as
48  *    a texture target.
49  *
50  *    Make sure that the functions report GL_INVALID_ENUM error if
51  *    GL_TEXTURE_IMMUTABLE_FORMAT is passed by pname argument.
52  *
53  *    Make sure that the functions report GL_INVALID_VALUE error if the following
54  *    pname+value combinations are used:
55  *
56  *    - GL_TEXTURE_BASE_LEVEL       + -1; (iv() version only)
57  *    - GL_TEXTURE_MAX_LEVEL        + -1; (iv() version only)
58 
59  *    Make sure that the functions report GL_INVALID_ENUM error if the following
60  *    pname+value combinations are used:
61  *
62  *    - GL_TEXTURE_COMPARE_MODE + GL_NEAREST;
63  *    - GL_TEXTURE_COMPARE_FUNC + GL_NEAREST;
64  *    - GL_TEXTURE_MAG_FILTER   + GL_NEAREST_MIPMAP_NEAREST;
65  *    - GL_TEXTURE_MIN_FILTER   + GL_RED;
66  *    - GL_TEXTURE_SWIZZLE_R    + GL_NEAREST;
67  *    - GL_TEXTURE_SWIZZLE_G    + GL_NEAREST;
68  *    - GL_TEXTURE_SWIZZLE_B    + GL_NEAREST;
69  *    - GL_TEXTURE_SWIZZLE_A    + GL_NEAREST;
70  *    - GL_TEXTURE_WRAP_S       + GL_RED;
71  *    - GL_TEXTURE_WRAP_T       + GL_RED;
72  *    - GL_TEXTURE_WRAP_R       + GL_RED;
73  *
74  *    Make sure that the functions report GL_INVALID_ENUM error if the following
75  *    pname+value pairs are used for GL_TEXTURE_2D_MULTISAMPLE or
76  *    GL_TEXTURE_2D_MULTISAMPLE_ARRAY_OES targets:
77  *
78  *    - GL_TEXTURE_COMPARE_MODE + GL_NONE;
79  *    - GL_TEXTURE_COMPARE_FUNC + GL_LEQUAL;
80  *    - GL_TEXTURE_MAG_FILTER   + GL_LINEAR;
81  *    - GL_TEXTURE_MAX_LOD   *  + 1000;
82  *    - GL_TEXTURE_MIN_FILTER   + GL_NEAREST_MIPMAP_LINEAR;
83  *    - GL_TEXTURE_MIN_LOD   *  + -1000;
84  *    - GL_TEXTURE_WRAP_S   *   + GL_REPEAT;
85  *    - GL_TEXTURE_WRAP_T   *   + GL_REPEAT;
86  *    - GL_TEXTURE_WRAP_R   *   + GL_REPEAT;
87  *
88  *    All texture targets available in ES3.1, as well as
89  *    GL_TEXTURE_CUBE_MAP_ARRAY_EXT (if supported) should be checked (for cases
90  *    2 and 3);
91  */
92 class TextureBorderClampTexParameterIErrorsTest : public TextureBorderClampBase
93 {
94 public:
95     /* Public functions */
96     TextureBorderClampTexParameterIErrorsTest(Context &context, const ExtParameters &extParams, const char *name,
97                                               const char *description);
98 
~TextureBorderClampTexParameterIErrorsTest()99     virtual ~TextureBorderClampTexParameterIErrorsTest()
100     {
101     }
102 
103     virtual IterateResult iterate(void);
104 
105 private:
106     /* Private functions */
107     virtual void initTest(void);
108 
109     void VerifyGLTexParameterIiv(glw::GLenum target, glw::GLenum pname, glw::GLint params, glw::GLenum expected_error);
110 
111     void VerifyGLTexParameterIivMultipleAcceptedErrors(glw::GLenum target, glw::GLenum pname, glw::GLint params,
112                                                        glw::GLenum expected_error1, glw::GLenum expected_error2);
113 
114     void VerifyGLTexParameterIivForAll(glw::GLenum pname, glw::GLint params, glw::GLenum expected_error);
115 
116     void VerifyGLTexParameterIivTextureBaseLevelForAll(glw::GLenum pname, glw::GLint params,
117                                                        glw::GLenum expected_error);
118 
119     void VerifyGLTexParameterIuiv(glw::GLenum target, glw::GLenum pname, glw::GLuint params,
120                                   glw::GLenum expected_error);
121 
122     void VerifyGLTexParameterIuivForAll(glw::GLenum pname, glw::GLuint params, glw::GLenum expected_error);
123 
124     /* Private variables */
125     glw::GLboolean m_test_passed;
126 };
127 
128 } // namespace glcts
129 
130 #endif // _ESEXTCTEXTUREBORDERCLAMPTEXPARAMETERIERRORS_HPP
131