1e5c31af7Sopenharmony_ci#ifndef _ES31FNEGATIVETESTSHARED_HPP
2e5c31af7Sopenharmony_ci#define _ES31FNEGATIVETESTSHARED_HPP
3e5c31af7Sopenharmony_ci/*-------------------------------------------------------------------------
4e5c31af7Sopenharmony_ci * drawElements Quality Program OpenGL ES 3.1 Module
5e5c31af7Sopenharmony_ci * -------------------------------------------------
6e5c31af7Sopenharmony_ci *
7e5c31af7Sopenharmony_ci * Copyright 2014 The Android Open Source Project
8e5c31af7Sopenharmony_ci *
9e5c31af7Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
10e5c31af7Sopenharmony_ci * you may not use this file except in compliance with the License.
11e5c31af7Sopenharmony_ci * You may obtain a copy of the License at
12e5c31af7Sopenharmony_ci *
13e5c31af7Sopenharmony_ci *      http://www.apache.org/licenses/LICENSE-2.0
14e5c31af7Sopenharmony_ci *
15e5c31af7Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
16e5c31af7Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
17e5c31af7Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18e5c31af7Sopenharmony_ci * See the License for the specific language governing permissions and
19e5c31af7Sopenharmony_ci * limitations under the License.
20e5c31af7Sopenharmony_ci *
21e5c31af7Sopenharmony_ci *//*!
22e5c31af7Sopenharmony_ci * \file
23e5c31af7Sopenharmony_ci * \brief Shared structures for ES 3.1 negative API tests
24e5c31af7Sopenharmony_ci *//*--------------------------------------------------------------------*/
25e5c31af7Sopenharmony_ci
26e5c31af7Sopenharmony_ci#include "tcuDefs.hpp"
27e5c31af7Sopenharmony_ci#include "glwDefs.hpp"
28e5c31af7Sopenharmony_ci#include "gluCallLogWrapper.hpp"
29e5c31af7Sopenharmony_ci#include "gluShaderUtil.hpp"
30e5c31af7Sopenharmony_ci#include "tes31TestCase.hpp"
31e5c31af7Sopenharmony_ci
32e5c31af7Sopenharmony_cinamespace tcu
33e5c31af7Sopenharmony_ci{
34e5c31af7Sopenharmony_ci
35e5c31af7Sopenharmony_ciclass ResultCollector;
36e5c31af7Sopenharmony_ci
37e5c31af7Sopenharmony_ci} // tcu
38e5c31af7Sopenharmony_ci
39e5c31af7Sopenharmony_cinamespace deqp
40e5c31af7Sopenharmony_ci{
41e5c31af7Sopenharmony_cinamespace gles31
42e5c31af7Sopenharmony_ci{
43e5c31af7Sopenharmony_cinamespace Functional
44e5c31af7Sopenharmony_ci{
45e5c31af7Sopenharmony_cinamespace NegativeTestShared
46e5c31af7Sopenharmony_ci{
47e5c31af7Sopenharmony_ci
48e5c31af7Sopenharmony_ciclass ErrorCase : public TestCase
49e5c31af7Sopenharmony_ci{
50e5c31af7Sopenharmony_cipublic:
51e5c31af7Sopenharmony_ci								ErrorCase		(Context& ctx, const char* name, const char* desc);
52e5c31af7Sopenharmony_ci	virtual						~ErrorCase		(void) {}
53e5c31af7Sopenharmony_ci
54e5c31af7Sopenharmony_ci	virtual void				expectError		(glw::GLenum error0, glw::GLenum error1) = 0;
55e5c31af7Sopenharmony_ci};
56e5c31af7Sopenharmony_ci
57e5c31af7Sopenharmony_ciclass NegativeTestContext : public glu::CallLogWrapper
58e5c31af7Sopenharmony_ci{
59e5c31af7Sopenharmony_cipublic:
60e5c31af7Sopenharmony_ci								NegativeTestContext		(ErrorCase& host, glu::RenderContext& renderCtx, const glu::ContextInfo& ctxInfo, tcu::TestLog& log, tcu::ResultCollector& results, bool enableLog);
61e5c31af7Sopenharmony_ci								~NegativeTestContext	();
62e5c31af7Sopenharmony_ci
63e5c31af7Sopenharmony_ci	const tcu::ResultCollector&	getResults				(void) const;
64e5c31af7Sopenharmony_ci
65e5c31af7Sopenharmony_ci	void						fail					(const std::string& msg);
66e5c31af7Sopenharmony_ci	int							getInteger				(glw::GLenum pname) const;
67e5c31af7Sopenharmony_ci	const glu::RenderContext&	getRenderContext		(void) const { return m_renderCtx; }
68e5c31af7Sopenharmony_ci	const glu::ContextInfo&		getContextInfo			(void) const { return m_ctxInfo; }
69e5c31af7Sopenharmony_ci	void						beginSection			(const std::string& desc);
70e5c31af7Sopenharmony_ci	void						endSection				(void);
71e5c31af7Sopenharmony_ci
72e5c31af7Sopenharmony_ci	void						expectError				(glw::GLenum error);
73e5c31af7Sopenharmony_ci	void						expectError				(glw::GLenum error0, glw::GLenum error1);
74e5c31af7Sopenharmony_ci	bool						isShaderSupported		(glu::ShaderType shaderType);
75e5c31af7Sopenharmony_ci	bool						isExtensionSupported	(std::string extension);
76e5c31af7Sopenharmony_ci
77e5c31af7Sopenharmony_ciprotected:
78e5c31af7Sopenharmony_ci	ErrorCase&					m_host;
79e5c31af7Sopenharmony_ci
80e5c31af7Sopenharmony_ciprivate:
81e5c31af7Sopenharmony_ci	glu::RenderContext&			m_renderCtx;
82e5c31af7Sopenharmony_ci	const glu::ContextInfo&		m_ctxInfo;
83e5c31af7Sopenharmony_ci	tcu::ResultCollector&		m_results;
84e5c31af7Sopenharmony_ci	int							m_openSections;
85e5c31af7Sopenharmony_ci};
86e5c31af7Sopenharmony_ci
87e5c31af7Sopenharmony_citypedef void (*TestFunc)(NegativeTestContext& ctx);
88e5c31af7Sopenharmony_ci
89e5c31af7Sopenharmony_cistruct FunctionContainer
90e5c31af7Sopenharmony_ci{
91e5c31af7Sopenharmony_ci	TestFunc	function;
92e5c31af7Sopenharmony_ci	const char* name;
93e5c31af7Sopenharmony_ci	const char* desc;
94e5c31af7Sopenharmony_ci};
95e5c31af7Sopenharmony_ci
96e5c31af7Sopenharmony_ci} // NegativeTestShared
97e5c31af7Sopenharmony_ci} // Functional
98e5c31af7Sopenharmony_ci} // gles31
99e5c31af7Sopenharmony_ci} // deqp
100e5c31af7Sopenharmony_ci
101e5c31af7Sopenharmony_ci#endif // _ES31FNEGATIVETESTSHARED_HPP
102