Always apply flat qualifier to double inputs, same as int/uint
[platform/upstream/VK-GL-CTS.git] / external / openglcts / modules / common / glcTestPackage.cpp
1 /*-------------------------------------------------------------------------
2  * OpenGL Conformance Test Suite
3  * -----------------------------
4  *
5  * Copyright (c) 2016 Google Inc.
6  * Copyright (c) 2016 The Khronos Group Inc.
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  *      http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */ /*!
21  * \file
22  * \brief OpenGL Conformance Test Package Base Class
23  */ /*-------------------------------------------------------------------*/
24
25 #include "glcTestPackage.hpp"
26
27 namespace deqp
28 {
29
30 PackageContext::PackageContext(tcu::TestContext& testCtx, glu::ContextType renderContextType)
31         : m_context(testCtx, renderContextType), m_caseWrapper(m_context)
32 {
33 }
34
35 PackageContext::~PackageContext(void)
36 {
37 }
38
39 TestPackage::TestPackage(tcu::TestContext& testCtx, const char* name, const char* description,
40                                                  glu::ContextType renderContextType, const char* resourcesPath)
41         : tcu::TestPackage(testCtx, name, description)
42         , m_renderContextType(renderContextType)
43         , m_packageCtx(DE_NULL)
44         , m_archive(testCtx.getRootArchive(), resourcesPath)
45 {
46 }
47
48 TestPackage::~TestPackage(void)
49 {
50         // Destroy all children before destroying context since destructors may access context.
51         tcu::TestNode::deinit();
52         delete m_packageCtx;
53 }
54
55 void TestPackage::init(void)
56 {
57         try
58         {
59                 // Create context
60                 m_packageCtx = new PackageContext(m_testCtx, m_renderContextType);
61         }
62         catch (...)
63         {
64                 delete m_packageCtx;
65                 m_packageCtx = DE_NULL;
66
67                 throw;
68         }
69 }
70
71 void TestPackage::deinit(void)
72 {
73         tcu::TestNode::deinit();
74         delete m_packageCtx;
75         m_packageCtx = DE_NULL;
76 }
77
78 } // deqp