• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*-------------------------------------------------------------------------
2  * drawElements Quality Program EGL 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 Config query tests.
22  *//*--------------------------------------------------------------------*/
23 
24 #include "teglQueryConfigTests.hpp"
25 #include "teglSimpleConfigCase.hpp"
26 #include "tcuTestLog.hpp"
27 #include "tcuTestContext.hpp"
28 #include "tcuCommandLine.hpp"
29 #include "egluCallLogWrapper.hpp"
30 #include "egluStrUtil.hpp"
31 #include "egluUtil.hpp"
32 #include "eglwLibrary.hpp"
33 #include "eglwEnums.hpp"
34 #include "deRandom.hpp"
35 
36 #include <string>
37 #include <vector>
38 
39 namespace deqp
40 {
41 namespace egl
42 {
43 
44 using eglu::ConfigInfo;
45 using tcu::TestLog;
46 using namespace eglw;
47 
logConfigAttribute(TestLog & log,EGLenum attrib,EGLint value)48 static void logConfigAttribute (TestLog& log, EGLenum attrib, EGLint value)
49 {
50 	log << TestLog::Message << "  " << eglu::getConfigAttribName(attrib) << ": " << eglu::getConfigAttribValueStr(attrib, value) << TestLog::EndMessage;
51 }
52 
isAttributePresent(const eglu::Version & version,EGLenum attribute)53 static bool isAttributePresent (const eglu::Version& version, EGLenum attribute)
54 {
55 	switch (attribute)
56 	{
57 		case EGL_CONFORMANT:
58 			if (version < eglu::Version(1, 3)) return false;
59 			break;
60 		case EGL_LUMINANCE_SIZE:
61 		case EGL_ALPHA_MASK_SIZE:
62 		case EGL_COLOR_BUFFER_TYPE:
63 		case EGL_MATCH_NATIVE_PIXMAP:
64 			if (version < eglu::Version(1, 2)) return false;
65 			break;
66 		case EGL_BIND_TO_TEXTURE_RGB:
67 		case EGL_BIND_TO_TEXTURE_RGBA:
68 		case EGL_MAX_SWAP_INTERVAL:
69 		case EGL_MIN_SWAP_INTERVAL:
70 		case EGL_RENDERABLE_TYPE:
71 			if (version < eglu::Version(1, 1)) return false;
72 			break;
73 		default:
74 			break;
75 	}
76 
77 	return true;
78 }
79 
hasRequiredExtension(const eglw::Library & egl,EGLDisplay display,EGLenum attribute)80 static bool hasRequiredExtension(const eglw::Library& egl, EGLDisplay display, EGLenum attribute)
81 {
82 	switch (attribute)
83 	{
84 	case EGL_RECORDABLE_ANDROID:
85 		return eglu::hasExtension(egl, display, "EGL_ANDROID_recordable");
86 	default:
87 		break;
88 	}
89 
90 	return true;
91 }
92 
93 class GetConfigsBoundsCase : public TestCase, protected eglu::CallLogWrapper
94 {
95 public:
GetConfigsBoundsCase(EglTestContext & eglTestCtx,const char * name,const char * description)96 	GetConfigsBoundsCase (EglTestContext& eglTestCtx, const char* name, const char* description)
97 		: TestCase		(eglTestCtx, name, description)
98 		, CallLogWrapper(eglTestCtx.getLibrary(), eglTestCtx.getTestContext().getLog())
99 		, m_display		(EGL_NO_DISPLAY)
100 	{
101 	}
102 
init(void)103 	void init (void)
104 	{
105 		DE_ASSERT(m_display == EGL_NO_DISPLAY);
106 		m_display = eglu::getAndInitDisplay(m_eglTestCtx.getNativeDisplay());
107 		m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass");
108 	}
109 
deinit(void)110 	void deinit (void)
111 	{
112 		m_eglTestCtx.getLibrary().terminate(m_display);
113 		m_display = EGL_NO_DISPLAY;
114 	}
115 
checkGetConfigsBounds(de::Random & rnd,const int numConfigAll,const int numConfigRequested)116 	void checkGetConfigsBounds (de::Random& rnd, const int numConfigAll, const int numConfigRequested)
117 	{
118 		tcu::TestLog&			log				= m_testCtx.getLog();
119 		std::vector<EGLConfig>	buffer			(numConfigAll + 10);
120 
121 		std::vector<deUint32>	magicBuffer		((buffer.size() * sizeof(EGLConfig)) / sizeof(deUint32) + 1);
122 		const EGLConfig*		magicConfigs	= reinterpret_cast<EGLConfig*>(&magicBuffer[0]);
123 
124 		int						numConfigReturned;
125 
126 		// Fill buffers with magic
127 		for (size_t ndx = 0; ndx < magicBuffer.size(); ndx++)	magicBuffer[ndx]	= rnd.getUint32();
128 		for (size_t ndx = 0; ndx < buffer.size(); ndx++)		buffer[ndx]			= magicConfigs[ndx];
129 
130 		eglGetConfigs(m_display, &buffer[0], numConfigRequested, &numConfigReturned);
131 		eglu::checkError(eglGetError(), DE_NULL, __FILE__, __LINE__);
132 
133 		log << TestLog::Message << numConfigReturned << " configs returned" << TestLog::EndMessage;
134 
135 		// Compare results with stored magic
136 		{
137 			int	numOverwritten	= 0;
138 
139 			for (size_t ndx = 0; ndx < buffer.size(); ndx++)
140 			{
141 				if (buffer[ndx] == magicConfigs[ndx])
142 				{
143 					numOverwritten = (int)ndx;
144 					break;
145 				}
146 			}
147 
148 			log << TestLog::Message << numOverwritten << " values actually written" << TestLog::EndMessage;
149 
150 			if (numConfigReturned > deMax32(numConfigRequested, 0))
151 			{
152 				log << TestLog::Message << "Fail, more configs returned than requested." << TestLog::EndMessage;
153 				m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Too many configs returned");
154 			}
155 
156 			if (numOverwritten > deMax32(numConfigReturned, 0))
157 			{
158 				log << TestLog::Message << "Fail, buffer overflow detected." << TestLog::EndMessage;
159 				m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Buffer overflow");
160 			}
161 			else if (numOverwritten != numConfigReturned)
162 			{
163 				log << TestLog::Message << "Fail, reported number of returned configs differs from number of values written." << TestLog::EndMessage;
164 				m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Incorrect size");
165 			}
166 		}
167 	}
168 
iterate(void)169 	IterateResult iterate (void)
170 	{
171 		tcu::TestLog&	log		= m_testCtx.getLog();
172 		EGLint			numConfigAll;
173 
174 		enableLogging(true);
175 
176 		eglGetConfigs(m_display, 0, 0, &numConfigAll);
177 
178 		log << TestLog::Message << numConfigAll << " configs available" << TestLog::EndMessage;
179 		log << TestLog::Message << TestLog::EndMessage;
180 
181 		if (numConfigAll > 0)
182 		{
183 			de::Random		rnd					(123);
184 
185 			for (int i = 0; i < 5; i++)
186 			{
187 				checkGetConfigsBounds(rnd, numConfigAll, rnd.getInt(0, numConfigAll));
188 				log << TestLog::Message << TestLog::EndMessage;
189 			}
190 
191 			checkGetConfigsBounds(rnd, numConfigAll, -1);
192 		}
193 		else
194 		{
195 			m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "No configs");
196 		}
197 
198 		enableLogging(false);
199 
200 		return STOP;
201 	}
202 
203 protected:
204 	EGLDisplay	m_display;
205 };
206 
207 class GetConfigAttribCase : public TestCase, protected eglu::CallLogWrapper
208 {
209 public:
210 	GetConfigAttribCase (EglTestContext& eglTestCtx, const char* name, const char* description);
211 
212 	void			init		(void);
213 	void			deinit		(void);
214 	IterateResult	iterate		(void);
215 
216 	EGLint			getValue	(EGLConfig config, EGLenum attrib, bool logValue=true);
217 
218 	virtual void	executeTest	(EGLConfig config) = 0;
219 
220 protected:
221 	EGLDisplay								m_display;
222 
223 private:
224 	std::vector<EGLConfig>					m_configs;
225 	std::vector<EGLConfig>::const_iterator	m_configsIter;
226 };
227 
GetConfigAttribCase(EglTestContext & eglTestCtx,const char * name,const char * description)228 GetConfigAttribCase::GetConfigAttribCase (EglTestContext& eglTestCtx, const char* name, const char* description)
229 	: TestCase			(eglTestCtx, name, description)
230 	, CallLogWrapper	(eglTestCtx.getLibrary(), eglTestCtx.getTestContext().getLog())
231 	, m_display			(EGL_NO_DISPLAY)
232 {
233 }
234 
init(void)235 void GetConfigAttribCase::init (void)
236 {
237 	DE_ASSERT(m_display == EGL_NO_DISPLAY);
238 	m_display		= eglu::getAndInitDisplay(m_eglTestCtx.getNativeDisplay());
239 	m_configs		= eglu::getConfigs(m_eglTestCtx.getLibrary(), m_display);
240 	m_configsIter	= m_configs.begin();
241 
242 	m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass");
243 }
244 
deinit(void)245 void GetConfigAttribCase::deinit (void)
246 {
247 	m_eglTestCtx.getLibrary().terminate(m_display);
248 	m_display = EGL_NO_DISPLAY;
249 }
250 
iterate(void)251 tcu::TestNode::IterateResult GetConfigAttribCase::iterate (void)
252 {
253 	tcu::TestLog&	log		= m_testCtx.getLog();
254 
255 	if (m_configsIter == m_configs.end())
256 	{
257 		log << TestLog::Message << "No configs available." << TestLog::EndMessage;
258 		return STOP;
259 	}
260 
261 	{
262 		const EGLConfig	config	= *m_configsIter;
263 		EGLint			id;
264 
265 		eglGetConfigAttrib(m_display, config, EGL_CONFIG_ID, &id);
266 		eglu::checkError(eglGetError(), DE_NULL, __FILE__, __LINE__);
267 		log << TestLog::Message << "Config ID " << id << TestLog::EndMessage;
268 
269 		executeTest(config);
270 	}
271 
272 	log << TestLog::Message << TestLog::EndMessage;
273 
274 	m_configsIter++;
275 
276 	if (m_configsIter == m_configs.end())
277 		return STOP;
278 	else
279 		return CONTINUE;
280 }
281 
getValue(EGLConfig config,EGLenum attrib,bool logValue)282 EGLint GetConfigAttribCase::getValue (EGLConfig config, EGLenum attrib, bool logValue)
283 {
284 	TestLog&	log		= m_testCtx.getLog();
285 	EGLint		value;
286 
287 	eglGetConfigAttrib(m_display, config, attrib, &value);
288 	eglu::checkError(eglGetError(), DE_NULL, __FILE__, __LINE__);
289 
290 	if (logValue)
291 		logConfigAttribute(log, attrib, value);
292 
293 	return value;
294 }
295 
296 class GetConfigAttribSimpleCase : public GetConfigAttribCase
297 {
298 public:
GetConfigAttribSimpleCase(EglTestContext & eglTestCtx,const char * name,const char * description,EGLenum attribute)299 	GetConfigAttribSimpleCase (EglTestContext& eglTestCtx, const char* name, const char* description, EGLenum attribute)
300 		: GetConfigAttribCase(eglTestCtx, name, description)
301 		, m_attrib(attribute)
302 	{
303 	}
304 
checkColorBufferType(EGLint value)305 	void checkColorBufferType (EGLint value)
306 	{
307 		const bool isRGBBuffer			= value == EGL_RGB_BUFFER;
308 		const bool isLuminanceBuffer	= value == EGL_LUMINANCE_BUFFER;
309 		const bool isYuvBuffer			= value == EGL_YUV_BUFFER_EXT;
310 		const bool hasYuvSupport		= eglu::hasExtension(m_eglTestCtx.getLibrary(), m_display, "EGL_EXT_yuv_surface");
311 
312 		if (!(isRGBBuffer || isLuminanceBuffer || (isYuvBuffer && hasYuvSupport)))
313 		{
314 			TestLog&	log	= m_testCtx.getLog();
315 
316 			log << TestLog::Message << "Fail, invalid EGL_COLOR_BUFFER_TYPE value" << TestLog::EndMessage;
317 			m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Invalid value");
318 		}
319 	}
320 
checkCaveat(EGLint value)321 	void checkCaveat (EGLint value)
322 	{
323 		if (!(value == EGL_NONE || value == EGL_SLOW_CONFIG || value == EGL_NON_CONFORMANT_CONFIG))
324 		{
325 			TestLog&	log	= m_testCtx.getLog();
326 
327 			log << TestLog::Message << "Fail, invalid EGL_CONFIG_CAVEAT value" << TestLog::EndMessage;
328 			m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Invalid value");
329 		}
330 	}
331 
checkTransparentType(EGLint value)332 	void checkTransparentType (EGLint value)
333 	{
334 		if (!(value == EGL_NONE || value == EGL_TRANSPARENT_RGB))
335 		{
336 			TestLog&	log	= m_testCtx.getLog();
337 
338 			log << TestLog::Message << "Fail, invalid EGL_TRANSPARENT_TYPE value" << TestLog::EndMessage;
339 			m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Invalid value");
340 		}
341 	}
342 
checkBoolean(EGLenum attrib,EGLint value)343 	void checkBoolean (EGLenum attrib, EGLint value)
344 	{
345 		if (!(value == EGL_FALSE || value == EGL_TRUE))
346 		{
347 			TestLog&	log	= m_testCtx.getLog();
348 
349 			log << TestLog::Message << "Fail, " << eglu::getConfigAttribStr(attrib) << " should be a boolean value." << TestLog::EndMessage;
350 			m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Invalid value");
351 		}
352 	}
353 
checkInteger(EGLenum attrib,EGLint value)354 	void checkInteger (EGLenum attrib, EGLint value)
355 	{
356 		if (attrib == EGL_NATIVE_VISUAL_ID || attrib == EGL_NATIVE_VISUAL_TYPE) // Implementation-defined
357 			return;
358 
359 		if (attrib == EGL_CONFIG_ID && value < 1)
360 		{
361 			TestLog&	log	= m_testCtx.getLog();
362 
363 			log << TestLog::Message << "Fail, config IDs should be positive integer values beginning from 1." << TestLog::EndMessage;
364 			m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Invalid value");
365 		}
366 	}
367 
checkSurfaceTypeMask(EGLint value)368 	void checkSurfaceTypeMask (EGLint value)
369 	{
370 		const EGLint	wantedBits	= EGL_WINDOW_BIT | EGL_PIXMAP_BIT | EGL_PBUFFER_BIT;
371 
372 		if ((value & wantedBits) == 0)
373 		{
374 			TestLog&	log	= m_testCtx.getLog();
375 
376 			log << TestLog::Message << "Fail, config does not actually support creation of any surface type?" << TestLog::EndMessage;
377 			m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Invalid value");
378 		}
379 	}
380 
checkAttribute(EGLenum attrib,EGLint value)381 	void checkAttribute (EGLenum attrib, EGLint value)
382 	{
383 		switch (attrib)
384 		{
385 			case EGL_COLOR_BUFFER_TYPE:
386 				checkColorBufferType(value);
387 				break;
388 			case EGL_CONFIG_CAVEAT:
389 				checkCaveat(value);
390 				break;
391 			case EGL_TRANSPARENT_TYPE:
392 				checkTransparentType(value);
393 				break;
394 			case EGL_CONFORMANT:
395 			case EGL_RENDERABLE_TYPE:
396 				// Just print what we know
397 				break;
398 			case EGL_SURFACE_TYPE:
399 				checkSurfaceTypeMask(value);
400 				break;
401 			case EGL_BIND_TO_TEXTURE_RGB:
402 			case EGL_BIND_TO_TEXTURE_RGBA:
403 			case EGL_NATIVE_RENDERABLE:
404 			case EGL_RECORDABLE_ANDROID:
405 				checkBoolean(attrib, value);
406 				break;
407 			default:
408 				checkInteger(attrib, value);
409 		}
410 	}
411 
executeTest(EGLConfig config)412 	void executeTest (EGLConfig config)
413 	{
414 		TestLog&			log		= m_testCtx.getLog();
415 		eglu::Version		version	= eglu::getVersion(m_eglTestCtx.getLibrary(), m_display);
416 
417 		if (!isAttributePresent(version, m_attrib))
418 		{
419 			log << TestLog::Message << eglu::getConfigAttribStr(m_attrib) << " not supported by this EGL version";
420 		}
421 		else if(!hasRequiredExtension(m_eglTestCtx.getLibrary(), m_display, m_attrib))
422 		{
423 			std::string     message = std::string(eglu::getConfigAttribName(m_attrib)) + " not supported due to missing extension";
424 			TCU_THROW(NotSupportedError, message);
425 		}
426 		else
427 		{
428 			EGLint			value;
429 
430 			enableLogging(true);
431 
432 			eglGetConfigAttrib(m_display, config, m_attrib, &value);
433 			eglu::checkError(eglGetError(), DE_NULL, __FILE__, __LINE__);
434 
435 			logConfigAttribute(log, m_attrib, value);
436 			checkAttribute(m_attrib, value);
437 
438 			enableLogging(false);
439 		}
440 	}
441 
442 private:
443 	EGLenum	m_attrib;
444 };
445 
446 class GetConfigAttribBufferSizeCase : public GetConfigAttribCase
447 {
448 public:
GetConfigAttribBufferSizeCase(EglTestContext & eglTestCtx,const char * name,const char * description)449 	GetConfigAttribBufferSizeCase (EglTestContext& eglTestCtx, const char* name, const char* description)
450 		: GetConfigAttribCase(eglTestCtx, name, description)
451 	{
452 	}
453 
executeTest(EGLConfig config)454 	void executeTest (EGLConfig config)
455 	{
456 		TestLog&		log				= m_testCtx.getLog();
457 
458 		const EGLint	colorBufferType	= getValue(config, EGL_COLOR_BUFFER_TYPE);
459 
460 		const EGLint	bufferSize		= getValue(config, EGL_BUFFER_SIZE);
461 		const EGLint	redSize			= getValue(config, EGL_RED_SIZE);
462 		const EGLint	greenSize		= getValue(config, EGL_GREEN_SIZE);
463 		const EGLint	blueSize		= getValue(config, EGL_BLUE_SIZE);
464 		const EGLint	luminanceSize	= getValue(config, EGL_LUMINANCE_SIZE);
465 		const EGLint	alphaSize		= getValue(config, EGL_ALPHA_SIZE);
466 
467 		if (alphaSize < 0)
468 		{
469 			log << TestLog::Message << "Fail, alpha size must be zero or positive." << TestLog::EndMessage;
470 			m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Invalid alpha size");
471 		}
472 
473 		if (colorBufferType == EGL_RGB_BUFFER)
474 		{
475 			if (luminanceSize != 0)
476 			{
477 				log << TestLog::Message << "Fail, luminance size must be zero for an RGB buffer." << TestLog::EndMessage;
478 				m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Invalid luminance size");
479 			}
480 
481 			if (redSize <= 0 || greenSize <= 0  || blueSize <= 0)
482 			{
483 				log << TestLog::Message << "Fail, RGB component sizes must be positive for an RGB buffer." << TestLog::EndMessage;
484 				m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Invalid color component size");
485 			}
486 
487 			if (bufferSize != (redSize + greenSize + blueSize + alphaSize))
488 			{
489 				log << TestLog::Message << "Fail, buffer size must be equal to the sum of RGB component sizes and alpha size." << TestLog::EndMessage;
490 				m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Invalid buffer size");
491 			}
492 		}
493 		else if (colorBufferType == EGL_LUMINANCE_BUFFER)
494 		{
495 			if (luminanceSize <= 0)
496 			{
497 				log << TestLog::Message << "Fail, luminance size must be positive for a luminance buffer." << TestLog::EndMessage;
498 				m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Invalid luminance size");
499 			}
500 
501 			if (redSize != 0 || greenSize != 0  || blueSize != 0)
502 			{
503 				log << TestLog::Message << "Fail, RGB component sizes must be zero for a luminance buffer." << TestLog::EndMessage;
504 				m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Invalid color component size");
505 			}
506 
507 			if (bufferSize != (luminanceSize + alphaSize))
508 			{
509 				log << TestLog::Message << "Fail, buffer size must be equal to the sum of luminance size and alpha size." << TestLog::EndMessage;
510 				m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Invalid buffer size");
511 			}
512 		}
513 	}
514 };
515 
516 class GetConfigAttribTransparentValueCase : public GetConfigAttribCase
517 {
518 public:
GetConfigAttribTransparentValueCase(EglTestContext & eglTestCtx,const char * name,const char * description)519 	GetConfigAttribTransparentValueCase (EglTestContext& eglTestCtx, const char* name, const char* description)
520 		: GetConfigAttribCase(eglTestCtx, name, description)
521 	{
522 	}
523 
executeTest(EGLConfig config)524 	void executeTest (EGLConfig config)
525 	{
526 		TestLog&		log	= m_testCtx.getLog();
527 
528 		const EGLint	transparentType	= getValue(config, EGL_TRANSPARENT_TYPE);
529 		const EGLint	redValue		= getValue(config, EGL_TRANSPARENT_RED_VALUE);
530 		const EGLint	greenValue		= getValue(config, EGL_TRANSPARENT_GREEN_VALUE);
531 		const EGLint	blueValue		= getValue(config, EGL_TRANSPARENT_BLUE_VALUE);
532 
533 		const EGLint	redSize			= getValue(config, EGL_RED_SIZE);
534 		const EGLint	greenSize		= getValue(config, EGL_GREEN_SIZE);
535 		const EGLint	blueSize		= getValue(config, EGL_BLUE_SIZE);
536 
537 		if (transparentType == EGL_TRANSPARENT_RGB)
538 		{
539 			if (   (redValue	< 0	|| redValue		>= (1 << redSize))
540 				|| (greenValue	< 0	|| greenValue	>= (1 << greenSize))
541 				|| (blueValue	< 0	|| blueValue	>= (1 << blueSize))	)
542 			{
543 				log << TestLog::Message << "Fail, transparent color values must lie between 0 and the maximum component value." << TestLog::EndMessage;
544 				m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Invalid transparent color value");
545 			}
546 		}
547 	}
548 };
549 
QueryConfigTests(EglTestContext & eglTestCtx)550 QueryConfigTests::QueryConfigTests (EglTestContext& eglTestCtx)
551 	: TestCaseGroup(eglTestCtx, "query_config", "Surface config query tests")
552 {
553 }
554 
~QueryConfigTests(void)555 QueryConfigTests::~QueryConfigTests (void)
556 {
557 }
558 
init(void)559 void QueryConfigTests::init (void)
560 {
561 	// eglGetGonfigs
562 	{
563 		tcu::TestCaseGroup* getConfigsGroup = new tcu::TestCaseGroup(m_testCtx, "get_configs", "eglGetConfigs tests");
564 		addChild(getConfigsGroup);
565 
566 		getConfigsGroup->addChild(new GetConfigsBoundsCase(m_eglTestCtx, "get_configs_bounds", "eglGetConfigs bounds checking test"));
567 	}
568 
569 	// eglGetConfigAttrib
570 	{
571 		static const struct
572 		{
573 			EGLenum			attribute;
574 			const char*		testName;
575 		} attributes[] =
576 		{
577 			{ EGL_BUFFER_SIZE,				"buffer_size"				},
578 			{ EGL_RED_SIZE,					"red_size"					},
579 			{ EGL_GREEN_SIZE,				"green_size"				},
580 			{ EGL_BLUE_SIZE,				"blue_size"					},
581 			{ EGL_LUMINANCE_SIZE,			"luminance_size"			},
582 			{ EGL_ALPHA_SIZE,				"alpha_size"				},
583 			{ EGL_ALPHA_MASK_SIZE,			"alpha_mask_size"			},
584 			{ EGL_BIND_TO_TEXTURE_RGB,		"bind_to_texture_rgb"		},
585 			{ EGL_BIND_TO_TEXTURE_RGBA,		"bind_to_texture_rgba"		},
586 			{ EGL_COLOR_BUFFER_TYPE,		"color_buffer_type"			},
587 			{ EGL_CONFIG_CAVEAT,			"config_caveat"				},
588 			{ EGL_CONFIG_ID,				"config_id"					},
589 			{ EGL_CONFORMANT,				"conformant"				},
590 			{ EGL_DEPTH_SIZE,				"depth_size"				},
591 			{ EGL_LEVEL,					"level"						},
592 			{ EGL_MAX_SWAP_INTERVAL,		"max_swap_interval"			},
593 			{ EGL_MIN_SWAP_INTERVAL,		"min_swap_interval"			},
594 			{ EGL_NATIVE_RENDERABLE,		"native_renderable"			},
595 			{ EGL_NATIVE_VISUAL_TYPE,		"native_visual_type"		},
596 			{ EGL_RENDERABLE_TYPE,			"renderable_type"			},
597 			{ EGL_SAMPLE_BUFFERS,			"sample_buffers"			},
598 			{ EGL_SAMPLES,					"samples"					},
599 			{ EGL_STENCIL_SIZE,				"stencil_size"				},
600 			{ EGL_SURFACE_TYPE,				"surface_type"				},
601 			{ EGL_TRANSPARENT_TYPE,			"transparent_type"			},
602 			{ EGL_TRANSPARENT_RED_VALUE,	"transparent_red_value"		},
603 			{ EGL_TRANSPARENT_GREEN_VALUE,	"transparent_green_value"	},
604 			{ EGL_TRANSPARENT_BLUE_VALUE,	"transparent_blue_value"	},
605 			{ EGL_RECORDABLE_ANDROID,		"recordable_android"		},
606 		};
607 
608 		tcu::TestCaseGroup* simpleGroup = new tcu::TestCaseGroup(m_testCtx, "get_config_attrib", "eglGetConfigAttrib() tests");
609 		addChild(simpleGroup);
610 
611 		for (int ndx = 0; ndx < (int)DE_LENGTH_OF_ARRAY(attributes); ndx++)
612 		{
613 			simpleGroup->addChild(new GetConfigAttribSimpleCase(m_eglTestCtx, attributes[ndx].testName, "Simple attribute query case", attributes[ndx].attribute));
614 		}
615 	}
616 
617 	// Attribute constraints
618 	{
619 		tcu::TestCaseGroup* constraintsGroup = new tcu::TestCaseGroup(m_testCtx, "constraints", "Attribute constraint tests");
620 		addChild(constraintsGroup);
621 
622 		constraintsGroup->addChild(new GetConfigAttribBufferSizeCase(m_eglTestCtx,			"color_buffer_size",	"Color buffer component sizes"));
623 		constraintsGroup->addChild(new GetConfigAttribTransparentValueCase(m_eglTestCtx,	"transparent_value",	"Transparent color value"));
624 	}
625 }
626 
627 } // egl
628 } // deqp
629