Home | History | Annotate | Download | only in functional
      1 /*-------------------------------------------------------------------------
      2  * drawElements Quality Program OpenGL ES 3.1 Module
      3  * -------------------------------------------------
      4  *
      5  * Copyright 2014 The Android Open Source Project
      6  *
      7  * Licensed under the Apache License, Version 2.0 (the "License");
      8  * you may not use this file except in compliance with the License.
      9  * You may obtain a copy of the License at
     10  *
     11  *      http://www.apache.org/licenses/LICENSE-2.0
     12  *
     13  * Unless required by applicable law or agreed to in writing, software
     14  * distributed under the License is distributed on an "AS IS" BASIS,
     15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     16  * See the License for the specific language governing permissions and
     17  * limitations under the License.
     18  *
     19  *//*!
     20  * \file
     21  * \brief Integer state query tests
     22  *//*--------------------------------------------------------------------*/
     23 
     24 #include "es31fIntegerStateQueryTests.hpp"
     25 #include "tcuTestLog.hpp"
     26 #include "gluRenderContext.hpp"
     27 #include "gluCallLogWrapper.hpp"
     28 #include "gluContextInfo.hpp"
     29 #include "glwFunctions.hpp"
     30 #include "glwEnums.hpp"
     31 #include "deRandom.hpp"
     32 #include "glsStateQueryUtil.hpp"
     33 
     34 namespace deqp
     35 {
     36 namespace gles31
     37 {
     38 namespace Functional
     39 {
     40 namespace
     41 {
     42 
     43 using gls::StateQueryUtil::StateQueryMemoryWriteGuard;
     44 
     45 enum VerifierType
     46 {
     47 	VERIFIER_GETBOOLEAN = 0,
     48 	VERIFIER_GETINTEGER,
     49 	VERIFIER_GETINTEGER64,
     50 	VERIFIER_GETFLOAT
     51 };
     52 
     53 static const char* getVerifierSuffix (VerifierType type)
     54 {
     55 	switch (type)
     56 	{
     57 		case VERIFIER_GETBOOLEAN:	return "getboolean";
     58 		case VERIFIER_GETINTEGER:	return "getinteger";
     59 		case VERIFIER_GETINTEGER64:	return "getinteger64";
     60 		case VERIFIER_GETFLOAT:		return "getfloat";
     61 		default:
     62 			DE_ASSERT(DE_FALSE);
     63 			return DE_NULL;
     64 	}
     65 }
     66 
     67 static bool verifyValue (glu::CallLogWrapper& gl, glw::GLenum target, int refValue, VerifierType type)
     68 {
     69 	switch (type)
     70 	{
     71 		case VERIFIER_GETBOOLEAN:
     72 		{
     73 			StateQueryMemoryWriteGuard<glw::GLboolean> value;
     74 			gl.glGetBooleanv(target, &value);
     75 
     76 			GLU_EXPECT_NO_ERROR(gl.glGetError(), "glGetBooleanv");
     77 
     78 			if (value.isUndefined())
     79 			{
     80 				gl.getLog() << tcu::TestLog::Message << "Get* did not return a value." << tcu::TestLog::EndMessage;
     81 				return false;
     82 			}
     83 			else if (value != ((refValue == 0) ? (GL_FALSE) : (GL_TRUE)))
     84 			{
     85 				gl.getLog() << tcu::TestLog::Message << "Expected " << ((refValue == 0) ? (GL_FALSE) : (GL_TRUE)) << ", got " << ((value == 0) ? (GL_FALSE) : (GL_TRUE)) << tcu::TestLog::EndMessage;
     86 				return false;
     87 			}
     88 			else
     89 				return true;
     90 		}
     91 
     92 		case VERIFIER_GETINTEGER:
     93 		{
     94 			StateQueryMemoryWriteGuard<glw::GLint> value;
     95 			gl.glGetIntegerv(target, &value);
     96 
     97 			GLU_EXPECT_NO_ERROR(gl.glGetError(), "glGetIntegerv");
     98 
     99 			if (value.isUndefined())
    100 			{
    101 				gl.getLog() << tcu::TestLog::Message << "Get* did not return a value." << tcu::TestLog::EndMessage;
    102 				return false;
    103 			}
    104 			else if (value != refValue)
    105 			{
    106 				gl.getLog() << tcu::TestLog::Message << "Expected " << refValue << ", got " << value << tcu::TestLog::EndMessage;
    107 				return false;
    108 			}
    109 			else
    110 				return true;
    111 		}
    112 
    113 		case VERIFIER_GETINTEGER64:
    114 		{
    115 			StateQueryMemoryWriteGuard<glw::GLint64> value;
    116 			gl.glGetInteger64v(target, &value);
    117 
    118 			GLU_EXPECT_NO_ERROR(gl.glGetError(), "glGetInteger64v");
    119 
    120 			if (value.isUndefined())
    121 			{
    122 				gl.getLog() << tcu::TestLog::Message << "Get* did not return a value." << tcu::TestLog::EndMessage;
    123 				return false;
    124 			}
    125 			else if (value != (glw::GLint64)refValue)
    126 			{
    127 				gl.getLog() << tcu::TestLog::Message << "Expected " << refValue << ", got " << value << tcu::TestLog::EndMessage;
    128 				return false;
    129 			}
    130 			else
    131 				return true;
    132 		}
    133 
    134 		case VERIFIER_GETFLOAT:
    135 		{
    136 			StateQueryMemoryWriteGuard<glw::GLfloat> value;
    137 			gl.glGetFloatv(target, &value);
    138 
    139 			GLU_EXPECT_NO_ERROR(gl.glGetError(), "glGetFloatv");
    140 
    141 			if (value.isUndefined())
    142 			{
    143 				gl.getLog() << tcu::TestLog::Message << "Get* did not return a value." << tcu::TestLog::EndMessage;
    144 				return false;
    145 			}
    146 			else if (value != (glw::GLfloat)refValue)
    147 			{
    148 				gl.getLog() << tcu::TestLog::Message << "Expected " << refValue << ", got " << value << tcu::TestLog::EndMessage;
    149 				return false;
    150 			}
    151 			else
    152 				return true;
    153 		}
    154 
    155 		default:
    156 			DE_ASSERT(DE_FALSE);
    157 			return DE_NULL;
    158 	}
    159 }
    160 
    161 static bool verifyMinValue (glu::CallLogWrapper& gl, glw::GLenum target, int minValue, VerifierType type)
    162 {
    163 	switch (type)
    164 	{
    165 		case VERIFIER_GETBOOLEAN:
    166 		{
    167 			StateQueryMemoryWriteGuard<glw::GLboolean> value;
    168 			gl.glGetBooleanv(target, &value);
    169 
    170 			GLU_EXPECT_NO_ERROR(gl.glGetError(), "glGetBooleanv");
    171 
    172 			if (value.isUndefined())
    173 			{
    174 				gl.getLog() << tcu::TestLog::Message << "Get* did not return a value." << tcu::TestLog::EndMessage;
    175 				return false;
    176 			}
    177 			else if (minValue > 0 && value == GL_FALSE)
    178 			{
    179 				gl.getLog() << tcu::TestLog::Message << "Expected GL_TRUE, got GL_FALSE" << tcu::TestLog::EndMessage;
    180 				return false;
    181 			}
    182 			else
    183 				return true;
    184 		}
    185 
    186 		case VERIFIER_GETINTEGER:
    187 		{
    188 			StateQueryMemoryWriteGuard<glw::GLint> value;
    189 			gl.glGetIntegerv(target, &value);
    190 
    191 			GLU_EXPECT_NO_ERROR(gl.glGetError(), "glGetIntegerv");
    192 
    193 			if (value.isUndefined())
    194 			{
    195 				gl.getLog() << tcu::TestLog::Message << "Get* did not return a value." << tcu::TestLog::EndMessage;
    196 				return false;
    197 			}
    198 			else if (value < minValue)
    199 			{
    200 				gl.getLog() << tcu::TestLog::Message << "Expected greater or equal to " << minValue << ", got " << value << tcu::TestLog::EndMessage;
    201 				return false;
    202 			}
    203 			else
    204 				return true;
    205 		}
    206 
    207 		case VERIFIER_GETINTEGER64:
    208 		{
    209 			StateQueryMemoryWriteGuard<glw::GLint64> value;
    210 			gl.glGetInteger64v(target, &value);
    211 
    212 			GLU_EXPECT_NO_ERROR(gl.glGetError(), "glGetInteger64v");
    213 
    214 			if (value.isUndefined())
    215 			{
    216 				gl.getLog() << tcu::TestLog::Message << "Get* did not return a value." << tcu::TestLog::EndMessage;
    217 				return false;
    218 			}
    219 			else if (value < minValue)
    220 			{
    221 				gl.getLog() << tcu::TestLog::Message << "Expected greater or equal to " << minValue << ", got " << value << tcu::TestLog::EndMessage;
    222 				return false;
    223 			}
    224 			else
    225 				return true;
    226 		}
    227 
    228 		case VERIFIER_GETFLOAT:
    229 		{
    230 			StateQueryMemoryWriteGuard<glw::GLfloat> value;
    231 			gl.glGetFloatv(target, &value);
    232 
    233 			GLU_EXPECT_NO_ERROR(gl.glGetError(), "glGetFloatv");
    234 
    235 			if (value.isUndefined())
    236 			{
    237 				gl.getLog() << tcu::TestLog::Message << "Get* did not return a value." << tcu::TestLog::EndMessage;
    238 				return false;
    239 			}
    240 			else if (value < minValue)
    241 			{
    242 				gl.getLog() << tcu::TestLog::Message << "Expected greater or equal to " << minValue << ", got " << value << tcu::TestLog::EndMessage;
    243 				return false;
    244 			}
    245 			else
    246 				return true;
    247 		}
    248 
    249 		default:
    250 			DE_ASSERT(DE_FALSE);
    251 			return DE_NULL;
    252 	}
    253 }
    254 
    255 static bool verifyMaxValue (glu::CallLogWrapper& gl, glw::GLenum target, int maxValue, VerifierType type)
    256 {
    257 	switch (type)
    258 	{
    259 		case VERIFIER_GETBOOLEAN:
    260 		{
    261 			StateQueryMemoryWriteGuard<glw::GLboolean> value;
    262 			gl.glGetBooleanv(target, &value);
    263 
    264 			GLU_EXPECT_NO_ERROR(gl.glGetError(), "glGetBooleanv");
    265 
    266 			if (value.isUndefined())
    267 			{
    268 				gl.getLog() << tcu::TestLog::Message << "Get* did not return a value." << tcu::TestLog::EndMessage;
    269 				return false;
    270 			}
    271 			else if (maxValue < 0 && value == GL_FALSE)
    272 			{
    273 				gl.getLog() << tcu::TestLog::Message << "Expected GL_TRUE, got GL_FALSE" << tcu::TestLog::EndMessage;
    274 				return false;
    275 			}
    276 			else
    277 				return true;
    278 		}
    279 
    280 		case VERIFIER_GETINTEGER:
    281 		{
    282 			StateQueryMemoryWriteGuard<glw::GLint> value;
    283 			gl.glGetIntegerv(target, &value);
    284 
    285 			GLU_EXPECT_NO_ERROR(gl.glGetError(), "glGetIntegerv");
    286 
    287 			if (value.isUndefined())
    288 			{
    289 				gl.getLog() << tcu::TestLog::Message << "Get* did not return a value." << tcu::TestLog::EndMessage;
    290 				return false;
    291 			}
    292 			else if (value > maxValue)
    293 			{
    294 				gl.getLog() << tcu::TestLog::Message << "Expected less or equal to " << maxValue << ", got " << value << tcu::TestLog::EndMessage;
    295 				return false;
    296 			}
    297 			else
    298 				return true;
    299 		}
    300 
    301 		case VERIFIER_GETINTEGER64:
    302 		{
    303 			StateQueryMemoryWriteGuard<glw::GLint64> value;
    304 			gl.glGetInteger64v(target, &value);
    305 
    306 			GLU_EXPECT_NO_ERROR(gl.glGetError(), "glGetInteger64v");
    307 
    308 			if (value.isUndefined())
    309 			{
    310 				gl.getLog() << tcu::TestLog::Message << "Get* did not return a value." << tcu::TestLog::EndMessage;
    311 				return false;
    312 			}
    313 			else if (value > maxValue)
    314 			{
    315 				gl.getLog() << tcu::TestLog::Message << "Expected less or equal to " << maxValue << ", got " << value << tcu::TestLog::EndMessage;
    316 				return false;
    317 			}
    318 			else
    319 				return true;
    320 		}
    321 
    322 		case VERIFIER_GETFLOAT:
    323 		{
    324 			StateQueryMemoryWriteGuard<glw::GLfloat> value;
    325 			gl.glGetFloatv(target, &value);
    326 
    327 			GLU_EXPECT_NO_ERROR(gl.glGetError(), "glGetFloatv");
    328 
    329 			if (value.isUndefined())
    330 			{
    331 				gl.getLog() << tcu::TestLog::Message << "Get* did not return a value." << tcu::TestLog::EndMessage;
    332 				return false;
    333 			}
    334 			else if (value > maxValue)
    335 			{
    336 				gl.getLog() << tcu::TestLog::Message << "Expected less or equal to " << maxValue << ", got " << value << tcu::TestLog::EndMessage;
    337 				return false;
    338 			}
    339 			else
    340 				return true;
    341 		}
    342 
    343 		default:
    344 			DE_ASSERT(DE_FALSE);
    345 			return DE_NULL;
    346 	}
    347 }
    348 
    349 class SampleMaskCase : public TestCase
    350 {
    351 public:
    352 					SampleMaskCase	(Context& context, const char* name, const char* desc);
    353 
    354 private:
    355 	void			init			(void);
    356 	IterateResult	iterate			(void);
    357 
    358 	int				m_maxSampleMaskWords;
    359 };
    360 
    361 SampleMaskCase::SampleMaskCase (Context& context, const char* name, const char* desc)
    362 	: TestCase				(context, name, desc)
    363 	, m_maxSampleMaskWords	(-1)
    364 {
    365 }
    366 
    367 void SampleMaskCase::init (void)
    368 {
    369 	const glw::Functions& gl = m_context.getRenderContext().getFunctions();
    370 
    371 	gl.getIntegerv(GL_MAX_SAMPLE_MASK_WORDS, &m_maxSampleMaskWords);
    372 	m_testCtx.getLog() << tcu::TestLog::Message << "GL_MAX_SAMPLE_MASK_WORDS = " << m_maxSampleMaskWords << tcu::TestLog::EndMessage;
    373 }
    374 
    375 SampleMaskCase::IterateResult SampleMaskCase::iterate (void)
    376 {
    377 	glu::CallLogWrapper gl		(m_context.getRenderContext().getFunctions(), m_testCtx.getLog());
    378 	bool				error	= false;
    379 
    380 	gl.enableLogging(true);
    381 
    382 	// mask word count ok?
    383 	if (m_maxSampleMaskWords <= 0)
    384 	{
    385 		m_testCtx.getLog() << tcu::TestLog::Message << "Minimum value of GL_MAX_SAMPLE_MASK_WORDS is 1. Got " << m_maxSampleMaskWords << tcu::TestLog::EndMessage;
    386 		m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Invalid limit value");
    387 		return STOP;
    388 	}
    389 
    390 	// initial values
    391 	{
    392 		const tcu::ScopedLogSection section(m_testCtx.getLog(), "initial", "Initial values");
    393 
    394 		for (int ndx = 0; ndx < m_maxSampleMaskWords; ++ndx)
    395 		{
    396 			glw::GLint word = 0;
    397 			gl.glGetIntegeri_v(GL_SAMPLE_MASK_VALUE, ndx, &word);
    398 
    399 			if (word != -1)
    400 			{
    401 				m_testCtx.getLog() << tcu::TestLog::Message << "ERROR: Expected all bits set (-1), got " << word << tcu::TestLog::EndMessage;
    402 				error = true;
    403 			}
    404 		}
    405 	}
    406 
    407 	// random masks
    408 	{
    409 		const int					numRandomTest	= 20;
    410 		const tcu::ScopedLogSection section			(m_testCtx.getLog(), "random", "Random values");
    411 		de::Random					rnd				(0x4312);
    412 
    413 		for (int testNdx = 0; testNdx < numRandomTest; ++testNdx)
    414 		{
    415 			const glw::GLint	maskIndex		= (glw::GLint)(rnd.getUint32() % m_maxSampleMaskWords);
    416 			glw::GLint			mask			= (glw::GLint)(rnd.getUint32());
    417 			glw::GLint			queriedMask		= 0;
    418 
    419 			gl.glSampleMaski(maskIndex, mask);
    420 			gl.glGetIntegeri_v(GL_SAMPLE_MASK_VALUE, maskIndex, &queriedMask);
    421 
    422 			if (mask != queriedMask)
    423 			{
    424 				m_testCtx.getLog() << tcu::TestLog::Message << "ERROR: Expected " << mask << ", got " << queriedMask << tcu::TestLog::EndMessage;
    425 				error = true;
    426 			}
    427 		}
    428 	}
    429 
    430 	if (!error)
    431 		m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass");
    432 	else
    433 		m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Invalid mask value");
    434 
    435 	return STOP;
    436 }
    437 
    438 class MaxSamplesCase : public TestCase
    439 {
    440 public:
    441 						MaxSamplesCase	(Context& context, const char* name, const char* desc, glw::GLenum target, int minValue, VerifierType verifierType);
    442 private:
    443 	IterateResult		iterate			(void);
    444 
    445 	const glw::GLenum	m_target;
    446 	const int			m_minValue;
    447 	const VerifierType	m_verifierType;
    448 };
    449 
    450 MaxSamplesCase::MaxSamplesCase (Context& context, const char* name, const char* desc, glw::GLenum target, int minValue, VerifierType verifierType)
    451 	: TestCase			(context, name, desc)
    452 	, m_target			(target)
    453 	, m_minValue		(minValue)
    454 	, m_verifierType	(verifierType)
    455 {
    456 }
    457 
    458 MaxSamplesCase::IterateResult MaxSamplesCase::iterate (void)
    459 {
    460 	glu::CallLogWrapper gl(m_context.getRenderContext().getFunctions(), m_testCtx.getLog());
    461 
    462 	gl.enableLogging(true);
    463 
    464 	if (verifyMinValue(gl, m_target, m_minValue, m_verifierType))
    465 		m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass");
    466 	else
    467 		m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Value not in legal range");
    468 	return STOP;
    469 }
    470 
    471 class TexBindingCase : public TestCase
    472 {
    473 public:
    474 						TexBindingCase	(Context& context, const char* name, const char* desc, glw::GLenum texTarget, glw::GLenum bindTarget, VerifierType verifierType);
    475 private:
    476 	void				init			(void);
    477 	IterateResult		iterate			(void);
    478 
    479 	const glw::GLenum	m_texTarget;
    480 	const glw::GLenum	m_bindTarget;
    481 	const VerifierType	m_verifierType;
    482 };
    483 
    484 TexBindingCase::TexBindingCase (Context& context, const char* name, const char* desc, glw::GLenum texTarget, glw::GLenum bindTarget, VerifierType verifierType)
    485 	: TestCase			(context, name, desc)
    486 	, m_texTarget		(texTarget)
    487 	, m_bindTarget		(bindTarget)
    488 	, m_verifierType	(verifierType)
    489 {
    490 }
    491 
    492 void TexBindingCase::init (void)
    493 {
    494 	if (m_texTarget == GL_TEXTURE_2D_MULTISAMPLE_ARRAY && !m_context.getContextInfo().isExtensionSupported("GL_OES_texture_storage_multisample_2d_array"))
    495 		throw tcu::NotSupportedError("Test requires OES_texture_storage_multisample_2d_array extension");
    496 }
    497 
    498 TexBindingCase::IterateResult TexBindingCase::iterate (void)
    499 {
    500 	glu::CallLogWrapper gl		(m_context.getRenderContext().getFunctions(), m_testCtx.getLog());
    501 	bool				allOk	= true;
    502 
    503 	gl.enableLogging(true);
    504 
    505 	// initial
    506 	{
    507 		const tcu::ScopedLogSection section(m_testCtx.getLog(), "initial", "Initial value");
    508 
    509 		allOk &= verifyValue(gl, m_bindTarget, 0, m_verifierType);
    510 	}
    511 
    512 	// bind
    513 	{
    514 		const tcu::ScopedLogSection section(m_testCtx.getLog(), "bind", "After bind");
    515 
    516 		glw::GLuint texture;
    517 
    518 		gl.glGenTextures(1, &texture);
    519 		gl.glBindTexture(m_texTarget, texture);
    520 		GLU_EXPECT_NO_ERROR(gl.glGetError(), "bind texture");
    521 
    522 		allOk &= verifyValue(gl, m_bindTarget, texture, m_verifierType);
    523 
    524 		gl.glDeleteTextures(1, &texture);
    525 	}
    526 
    527 	// after delete
    528 	{
    529 		const tcu::ScopedLogSection section(m_testCtx.getLog(), "bind", "After delete");
    530 
    531 		allOk &= verifyValue(gl, m_bindTarget, 0, m_verifierType);
    532 	}
    533 
    534 	if (allOk)
    535 		m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass");
    536 	else
    537 		m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Got invalid value");
    538 	return STOP;
    539 }
    540 
    541 class MinimumValueCase : public TestCase
    542 {
    543 public:
    544 						MinimumValueCase	(Context& context, const char* name, const char* desc, glw::GLenum target, int minValue, VerifierType verifierType);
    545 private:
    546 	IterateResult		iterate				(void);
    547 
    548 	const glw::GLenum	m_target;
    549 	const int			m_minValue;
    550 	const VerifierType	m_verifierType;
    551 };
    552 
    553 MinimumValueCase::MinimumValueCase (Context& context, const char* name, const char* desc, glw::GLenum target, int minValue, VerifierType verifierType)
    554 	: TestCase			(context, name, desc)
    555 	, m_target			(target)
    556 	, m_minValue		(minValue)
    557 	, m_verifierType	(verifierType)
    558 {
    559 }
    560 
    561 MinimumValueCase::IterateResult MinimumValueCase::iterate (void)
    562 {
    563 	glu::CallLogWrapper gl(m_context.getRenderContext().getFunctions(), m_testCtx.getLog());
    564 
    565 	gl.enableLogging(true);
    566 
    567 	if (verifyMinValue(gl, m_target, m_minValue, m_verifierType))
    568 		m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass");
    569 	else
    570 		m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Got invalid value");
    571 	return STOP;
    572 }
    573 
    574 class AlignmentCase : public TestCase
    575 {
    576 public:
    577 						AlignmentCase	(Context& context, const char* name, const char* desc, glw::GLenum target, int minValue, VerifierType verifierType);
    578 private:
    579 	IterateResult		iterate			(void);
    580 
    581 	const glw::GLenum	m_target;
    582 	const int			m_minValue;
    583 	const VerifierType	m_verifierType;
    584 };
    585 
    586 AlignmentCase::AlignmentCase (Context& context, const char* name, const char* desc, glw::GLenum target, int minValue, VerifierType verifierType)
    587 	: TestCase			(context, name, desc)
    588 	, m_target			(target)
    589 	, m_minValue		(minValue)
    590 	, m_verifierType	(verifierType)
    591 {
    592 }
    593 
    594 AlignmentCase::IterateResult AlignmentCase::iterate (void)
    595 {
    596 	glu::CallLogWrapper gl(m_context.getRenderContext().getFunctions(), m_testCtx.getLog());
    597 
    598 	gl.enableLogging(true);
    599 
    600 	if (verifyMaxValue(gl, m_target, m_minValue, m_verifierType))
    601 		m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass");
    602 	else
    603 		m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Got invalid value");
    604 	return STOP;
    605 }
    606 
    607 } // anonymous
    608 
    609 IntegerStateQueryTests::IntegerStateQueryTests (Context& context)
    610 	: TestCaseGroup(context, "integer", "Integer state query tests")
    611 {
    612 }
    613 
    614 IntegerStateQueryTests::~IntegerStateQueryTests (void)
    615 {
    616 }
    617 
    618 void IntegerStateQueryTests::init (void)
    619 {
    620 	// Verifiers
    621 	const VerifierType verifiers[] = { VERIFIER_GETBOOLEAN, VERIFIER_GETINTEGER, VERIFIER_GETINTEGER64, VERIFIER_GETFLOAT };
    622 
    623 #define FOR_EACH_VERIFIER(X) \
    624 	for (int verifierNdx = 0; verifierNdx < DE_LENGTH_OF_ARRAY(verifiers); ++verifierNdx)	\
    625 	{																						\
    626 		const char* verifierSuffix = getVerifierSuffix(verifiers[verifierNdx]);				\
    627 		const VerifierType verifier = verifiers[verifierNdx];								\
    628 		this->addChild(X);																	\
    629 	}
    630 
    631 	// No additional verifiers for sample_mask_value
    632 	this->addChild(new SampleMaskCase(m_context, "sample_mask_value", "Test sample mask value"));
    633 
    634 	FOR_EACH_VERIFIER(new MaxSamplesCase(m_context,		(std::string() + "max_color_texture_samples_" + verifierSuffix).c_str(),				"Test GL_MAX_COLOR_TEXTURE_SAMPLES",			GL_MAX_COLOR_TEXTURE_SAMPLES,		1,	verifier))
    635 	FOR_EACH_VERIFIER(new MaxSamplesCase(m_context,		(std::string() + "max_depth_texture_samples_" + verifierSuffix).c_str(),				"Test GL_MAX_DEPTH_TEXTURE_SAMPLES",			GL_MAX_DEPTH_TEXTURE_SAMPLES,		1,	verifier))
    636 	FOR_EACH_VERIFIER(new MaxSamplesCase(m_context,		(std::string() + "max_integer_samples_" + verifierSuffix).c_str(),						"Test GL_MAX_INTEGER_SAMPLES",					GL_MAX_INTEGER_SAMPLES,				1,	verifier))
    637 
    638 	FOR_EACH_VERIFIER(new TexBindingCase(m_context,		(std::string() + "texture_binding_2d_multisample_" + verifierSuffix).c_str(),			"Test TEXTURE_BINDING_2D_MULTISAMPLE",			GL_TEXTURE_2D_MULTISAMPLE,			GL_TEXTURE_BINDING_2D_MULTISAMPLE,			verifier))
    639 	FOR_EACH_VERIFIER(new TexBindingCase(m_context,		(std::string() + "texture_binding_2d_multisample_array_" + verifierSuffix).c_str(),		"Test TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY",	GL_TEXTURE_2D_MULTISAMPLE_ARRAY,	GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY,	verifier))
    640 
    641 	FOR_EACH_VERIFIER(new MinimumValueCase(m_context,	(std::string() + "max_vertex_attrib_relative_offset_" + verifierSuffix).c_str(),		"Test MAX_VERTEX_ATTRIB_RELATIVE_OFFSET",		GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET,	2047,	verifier))
    642 	FOR_EACH_VERIFIER(new MinimumValueCase(m_context,	(std::string() + "max_vertex_attrib_bindings_" + verifierSuffix).c_str(),				"Test MAX_VERTEX_ATTRIB_BINDINGS",				GL_MAX_VERTEX_ATTRIB_BINDINGS,			16,		verifier))
    643 	FOR_EACH_VERIFIER(new MinimumValueCase(m_context,	(std::string() + "max_vertex_attrib_stride_" + verifierSuffix).c_str(),					"Test MAX_VERTEX_ATTRIB_STRIDE",				GL_MAX_VERTEX_ATTRIB_STRIDE,			2048,	verifier))
    644 
    645 	FOR_EACH_VERIFIER(new AlignmentCase(m_context,		(std::string() + "shader_storage_buffer_offset_alignment_" + verifierSuffix).c_str(),	"Test SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT",	GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT,	256,	verifier))
    646 
    647 #undef FOR_EACH_VERIFIER
    648 }
    649 
    650 } // Functional
    651 } // gles31
    652 } // deqp
    653