1 /*-------------------------------------------------------------------------
2 * drawElements Quality Program OpenGL ES 3.1 Module
3 * -------------------------------------------------
5 * Copyright 2014 The Android Open Source Project
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
21 * \brief OpenGL ES 3.1 Test Case Wrapper.
22 *//*--------------------------------------------------------------------*/
24 #include "tes31TestCaseWrapper.hpp"
25 #include "gluStateReset.hpp"
26 #include "tcuTestLog.hpp"
27 #include "glwEnums.hpp"
28 #include "glwFunctions.hpp"
37 TestCaseWrapper::TestCaseWrapper (tcu::TestContext& testCtx, glu::RenderContext& renderCtx)
38 : tcu::TestCaseWrapper (testCtx)
39 , m_renderCtx (renderCtx)
41 // TCU_CHECK(renderCtx.getType() == glu::CONTEXTTYPE_GL43_CORE);
44 TestCaseWrapper::~TestCaseWrapper (void)
48 bool TestCaseWrapper::initTestCase (tcu::TestCase* testCase)
50 return tcu::TestCaseWrapper::initTestCase(testCase);
53 bool TestCaseWrapper::deinitTestCase (tcu::TestCase* testCase)
55 TestLog& log = m_testCtx.getLog();
57 if (!tcu::TestCaseWrapper::deinitTestCase(testCase))
63 glu::resetState(m_renderCtx);
65 catch (const std::exception& e)
68 log << TestLog::Message << "Error in state reset, test program will terminate." << TestLog::EndMessage;
75 tcu::TestNode::IterateResult TestCaseWrapper::iterateTestCase (tcu::TestCase* testCase)
77 tcu::TestCase::IterateResult result = tcu::TestCaseWrapper::iterateTestCase(testCase);
79 // Call implementation specific post-iterate routine (usually handles native events and swaps buffers)
82 m_renderCtx.postIterate();
85 catch (const tcu::ResourceError& e)
87 m_testCtx.getLog() << e;
88 m_testCtx.setTestResult(QP_TEST_RESULT_RESOURCE_ERROR, "Resource error in context post-iteration routine");
89 return tcu::TestNode::STOP;
91 catch (const std::exception& e)
93 m_testCtx.getLog() << e;
94 m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Error in context post-iteration routine");
95 return tcu::TestNode::STOP;