13c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#ifndef _ES31FNEGATIVETESTSHARED_HPP
23c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#define _ES31FNEGATIVETESTSHARED_HPP
33c827367444ee418f129b2c238299f49d3264554Jarkko Poyry/*-------------------------------------------------------------------------
43c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * drawElements Quality Program OpenGL ES 3.1 Module
53c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * -------------------------------------------------
63c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *
73c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * Copyright 2014 The Android Open Source Project
83c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *
93c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * Licensed under the Apache License, Version 2.0 (the "License");
103c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * you may not use this file except in compliance with the License.
113c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * You may obtain a copy of the License at
123c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *
133c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *      http://www.apache.org/licenses/LICENSE-2.0
143c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *
153c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * Unless required by applicable law or agreed to in writing, software
163c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * distributed under the License is distributed on an "AS IS" BASIS,
173c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
183c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * See the License for the specific language governing permissions and
193c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * limitations under the License.
203c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *
213c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *//*!
223c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * \file
233c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * \brief Shared structures for ES 3.1 negative API tests
243c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *//*--------------------------------------------------------------------*/
253c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
263c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#include "tcuDefs.hpp"
273c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#include "glwDefs.hpp"
283c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#include "gluCallLogWrapper.hpp"
29c0ef0b01a0958cd309cf0c23268fdedbaa6e21ccDaniel Andrade Groppe#include "gluShaderUtil.hpp"
303c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#include "tes31TestCase.hpp"
313c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
32ab44fc6da25bb126919615ad2ded101695251161Jarkko Pöyrynamespace tcu
33ab44fc6da25bb126919615ad2ded101695251161Jarkko Pöyry{
34ab44fc6da25bb126919615ad2ded101695251161Jarkko Pöyry
35ab44fc6da25bb126919615ad2ded101695251161Jarkko Pöyryclass ResultCollector;
36ab44fc6da25bb126919615ad2ded101695251161Jarkko Pöyry
37ab44fc6da25bb126919615ad2ded101695251161Jarkko Pöyry} // tcu
38ab44fc6da25bb126919615ad2ded101695251161Jarkko Pöyry
393c827367444ee418f129b2c238299f49d3264554Jarkko Poyrynamespace deqp
403c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{
413c827367444ee418f129b2c238299f49d3264554Jarkko Poyrynamespace gles31
423c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{
433c827367444ee418f129b2c238299f49d3264554Jarkko Poyrynamespace Functional
443c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{
453c827367444ee418f129b2c238299f49d3264554Jarkko Poyrynamespace NegativeTestShared
463c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{
473c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
483c827367444ee418f129b2c238299f49d3264554Jarkko Poyryclass ErrorCase : public TestCase
493c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{
503c827367444ee418f129b2c238299f49d3264554Jarkko Poyrypublic:
513c827367444ee418f129b2c238299f49d3264554Jarkko Poyry								ErrorCase		(Context& ctx, const char* name, const char* desc);
52a15e7d7f566d93c76ca90171eb728e3d1cd82378Pyry Haulos	virtual						~ErrorCase		(void) {}
533c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
543c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	virtual void				expectError		(glw::GLenum error0, glw::GLenum error1) = 0;
553c827367444ee418f129b2c238299f49d3264554Jarkko Poyry};
563c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
573c827367444ee418f129b2c238299f49d3264554Jarkko Poyryclass NegativeTestContext : public glu::CallLogWrapper
583c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{
593c827367444ee418f129b2c238299f49d3264554Jarkko Poyrypublic:
60271c2654cc44f23492888c7ef40c36c2fd810c77Jarkko Pöyry								NegativeTestContext		(ErrorCase& host, glu::RenderContext& renderCtx, const glu::ContextInfo& ctxInfo, tcu::TestLog& log, tcu::ResultCollector& results, bool enableLog);
613c827367444ee418f129b2c238299f49d3264554Jarkko Poyry								~NegativeTestContext	();
623c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
633c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	const tcu::ResultCollector&	getResults				(void) const;
643c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
653c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	void						fail					(const std::string& msg);
663c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	int							getInteger				(glw::GLenum pname) const;
673c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	const glu::RenderContext&	getRenderContext		(void) const { return m_renderCtx; }
68a15e7d7f566d93c76ca90171eb728e3d1cd82378Pyry Haulos	const glu::ContextInfo&		getContextInfo			(void) const { return m_ctxInfo; }
693c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	void						beginSection			(const std::string& desc);
703c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	void						endSection				(void);
713c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
723c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	void						expectError				(glw::GLenum error);
733c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	void						expectError				(glw::GLenum error0, glw::GLenum error1);
74c0ef0b01a0958cd309cf0c23268fdedbaa6e21ccDaniel Andrade Groppe	bool						isShaderSupported		(glu::ShaderType shaderType);
75a15e7d7f566d93c76ca90171eb728e3d1cd82378Pyry Haulos	bool						isExtensionSupported	(std::string extension);
763c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
77e4f5e0c8d113561d40edb72cb5cf3c8b0495518fJarkko Pöyryprotected:
78e4f5e0c8d113561d40edb72cb5cf3c8b0495518fJarkko Pöyry	ErrorCase&					m_host;
79e4f5e0c8d113561d40edb72cb5cf3c8b0495518fJarkko Pöyry
803c827367444ee418f129b2c238299f49d3264554Jarkko Poyryprivate:
813c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	glu::RenderContext&			m_renderCtx;
82a15e7d7f566d93c76ca90171eb728e3d1cd82378Pyry Haulos	const glu::ContextInfo&		m_ctxInfo;
833c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	tcu::ResultCollector&		m_results;
843c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	int							m_openSections;
853c827367444ee418f129b2c238299f49d3264554Jarkko Poyry};
863c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
873c827367444ee418f129b2c238299f49d3264554Jarkko Poyrytypedef void (*TestFunc)(NegativeTestContext& ctx);
883c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
893c827367444ee418f129b2c238299f49d3264554Jarkko Poyrystruct FunctionContainer
903c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{
913c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	TestFunc	function;
923c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	const char* name;
933c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	const char* desc;
943c827367444ee418f129b2c238299f49d3264554Jarkko Poyry};
953c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
963c827367444ee418f129b2c238299f49d3264554Jarkko Poyry} // NegativeTestShared
973c827367444ee418f129b2c238299f49d3264554Jarkko Poyry} // Functional
983c827367444ee418f129b2c238299f49d3264554Jarkko Poyry} // gles31
993c827367444ee418f129b2c238299f49d3264554Jarkko Poyry} // deqp
1003c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1013c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#endif // _ES31FNEGATIVETESTSHARED_HPP
102