• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*------------------------------------------------------------------------
2  * Vulkan Conformance Tests
3  * ------------------------
4  *
5  * Copyright (c) 2016 The Khronos Group Inc.
6  * Copyright (c) 2016 Imagination Technologies Ltd.
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 Robust Buffer Access Tests
23  *//*--------------------------------------------------------------------*/
24 
25 #include "vktRobustnessTests.hpp"
26 #include "vktRobustnessExtsTests.hpp"
27 #include "vktRobustnessBufferAccessTests.hpp"
28 #include "vktRobustnessVertexAccessTests.hpp"
29 #include "vktRobustBufferAccessWithVariablePointersTests.hpp"
30 #include "vktNonRobustBufferAccessTests.hpp"
31 #include "vktTestGroupUtil.hpp"
32 
33 namespace vkt
34 {
35 namespace robustness
36 {
37 
38 namespace
39 {
40 
41 class IsNodeNamed
42 {
43 public:
IsNodeNamed(const std::string & name)44 	IsNodeNamed(const std::string& name)
45 		: checkName(name)
46 	{}
operator ()(tcu::TestNode * node)47 	bool operator()(tcu::TestNode* node)
48 	{
49 		return checkName == std::string(node->getName());
50 	}
51 private:
52 	const std::string checkName;
53 };
54 
55 }
56 
createTests(tcu::TestContext & testCtx)57 tcu::TestCaseGroup* createTests (tcu::TestContext& testCtx)
58 {
59 	de::MovePtr<tcu::TestCaseGroup> robustnessTests(new tcu::TestCaseGroup(testCtx, "robustness", ""));
60 
61 	robustnessTests->addChild(createBufferAccessTests(testCtx));
62 	robustnessTests->addChild(createVertexAccessTests(testCtx));
63 
64 	std::vector<tcu::TestNode*> children;
65 	robustnessTests->getChildren(children);
66 	std::vector<tcu::TestNode*>::iterator buffer_access = std::find_if(children.begin(), children.end(), IsNodeNamed("buffer_access"));
67 	if (buffer_access != children.end())
68 	{
69 		(*buffer_access)->addChild(createBufferAccessWithVariablePointersTests(testCtx));
70 	}
71 	else
72 	{
73 		de::MovePtr<tcu::TestCaseGroup> bufferAccess(new tcu::TestCaseGroup(testCtx, "buffer_access", ""));
74 		bufferAccess->addChild(createBufferAccessWithVariablePointersTests(testCtx));
75 		robustnessTests->addChild(bufferAccess.release());
76 	}
77 
78 	robustnessTests->addChild(createRobustness2Tests(testCtx));
79 	robustnessTests->addChild(createImageRobustnessTests(testCtx));
80 	robustnessTests->addChild(createNonRobustBufferAccessTests(testCtx));
81 
82 	return robustnessTests.release();
83 }
84 
85 } // robustness
86 } // vkt
87