#ifndef _GLCKHRDEBUGTESTS_HPP #define _GLCKHRDEBUGTESTS_HPP /*------------------------------------------------------------------------- * OpenGL Conformance Test Suite * ----------------------------- * * Copyright (c) 2015-2018 The Khronos Group Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ /*! * \file * \brief */ /*-------------------------------------------------------------------*/ /** * \file glcKHRDebugTests.hpp * \brief Declares test classes for "KHR Debug" functionality. */ /*-------------------------------------------------------------------*/ #include "glcTestCase.hpp" #include "glwDefs.hpp" #include "deThreadLocal.hpp" namespace glu { class RenderContext; } namespace glw { class Functions; } namespace glcts { namespace KHRDebug { /** Base of all test cases. * Manages rendering context **/ class TestBase { public: /* Public methods */ TestBase(tcu::TestContext& testContext, glu::ApiType apiType, bool is_debug); virtual ~TestBase(); protected: /* Protected methods */ void init(); void done(); /* Protected fields */ const glw::Functions* m_gl; const bool m_is_debug; glu::RenderContext* m_rc; private: /* Private methods */ void initDebug(); void initNonDebug(); /* Private fields */ tcu::TestContext& m_testContext; glu::ApiType m_apiType; }; /** Implementation of test APIErrors. Description follows: * * This test verifies that errors are generated as expected. * * This test should be executed for DEBUG and NON-DEBUG contexts. * * DebugMessageControl function should generate: * - INVALID_ENUM when is invalid; * - INVALID_ENUM when is invalid; * - INVALID_ENUM when is invalid; * - INVALID_VALUE when is negative; * - INVALID_OPERATION when is not zero and is DONT_CARE; * - INVALID_OPERATION when is not zero and is DONT_CARE; * - INVALID_OPERATION when is not zero and is not * DONT_CARE. * * GetDebugMessageLog function should generate: * - INVALID_VALUE when is negative and messageLog is not NULL. * * DebugMessageInsert function should generate: * - INVALID_ENUM when is not DEBUG_SOURCE_APPLICATION or * DEBUG_SOURCE_THIRD_PARTY; * - INVALID_ENUM when is invalid; * - INVALID_ENUM when is invalid; * - INVALID_VALUE when length of string is not less than * MAX_DEBUG_MESSAGE_LENGTH. * * PushDebugGroup function should generate: * - INVALID_ENUM when is not DEBUG_SOURCE_APPLICATION or * DEBUG_SOURCE_THIRD_PARTY; * - INVALID_VALUE when length of string is not less than * MAX_DEBUG_MESSAGE_LENGTH; * - STACK_OVERFLOW when stack contains MAX_DEBUG_GROUP_STACK_DEPTH entries. * * PopDebugGroup function should generate: * - STACK_UNDERFLOW when stack contains no entries. * * ObjectLabel function should generate: * - INVALID_ENUM when is invalid; * - INVALID_VALUE when if is not valid object name of type specified by * ; * - INVALID_VALUE when length of string