1 #ifndef _ES2FAPICASE_HPP
2 #define _ES2FAPICASE_HPP
3 /*-------------------------------------------------------------------------
4 * drawElements Quality Program OpenGL ES 2.0 Module
5 * -------------------------------------------------
7 * Copyright 2014 The Android Open Source Project
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
13 * http://www.apache.org/licenses/LICENSE-2.0
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.
23 * \brief API test case.
24 *//*--------------------------------------------------------------------*/
26 #include "tcuDefs.hpp"
27 #include "tes2TestCase.hpp"
28 #include "gluCallLogWrapper.hpp"
29 #include "tcuTestLog.hpp"
38 class ApiCase : public TestCase, protected glu::CallLogWrapper
41 ApiCase (Context& context, const char* name, const char* description);
42 virtual ~ApiCase (void);
44 IterateResult iterate (void);
47 virtual void test (void) = DE_NULL;
49 void expectError (deUint32 error);
50 void expectError (deUint32 error0, deUint32 error1);
51 void getSupportedExtensions (const deUint32 numSupportedValues, const deUint32 extension, std::vector<int>& values);
52 void checkBooleans (deUint8 value, deUint8 expected);
53 void checkBooleans (deInt32 value, deUint8 expected);
58 // Helper macro for declaring ApiCases.
59 #define ES2F_ADD_API_CASE(NAME, DESCRIPTION, TEST_FUNC_BODY) \
61 class ApiCase_##NAME : public ApiCase { \
63 ApiCase_##NAME (Context& context) : ApiCase(context, #NAME, DESCRIPTION) {} \
65 void test (void) TEST_FUNC_BODY /* NOLINT(TEST_FUNC_BODY) */ \
67 addChild(new ApiCase_##NAME(m_context)); \
68 } while (deGetFalse())
74 #endif // _ES2FAPICASE_HPP