Merge "Relax line width verification in primitive bbox tests" into nougat-cts-dev
[platform/upstream/VK-GL-CTS.git] / framework / common / tcuTestCase.cpp
index a8aeeb7..fb7a73f 100644 (file)
@@ -45,18 +45,18 @@ inline bool isValidCaseName (const char* name)
 
 TestNode::TestNode (TestContext& testCtx, TestNodeType nodeType, const char* name, const char* description)
        : m_testCtx             (testCtx)
-       , m_nodeType    (nodeType)
        , m_name                (name)
        , m_description (description)
+       , m_nodeType    (nodeType)
 {
        DE_ASSERT(isValidCaseName(name));
 }
 
 TestNode::TestNode (TestContext& testCtx, TestNodeType nodeType, const char* name, const char* description, const vector<TestNode*>& children)
        : m_testCtx             (testCtx)
-       , m_nodeType    (nodeType)
        , m_name                (name)
        , m_description (description)
+       , m_nodeType    (nodeType)
 {
        DE_ASSERT(isValidCaseName(name));
        for (int i = 0; i < (int)children.size(); i++)
@@ -68,7 +68,7 @@ TestNode::~TestNode (void)
        TestNode::deinit();
 }
 
-void TestNode::getChildren (vector<TestNode*>& res) const
+void TestNode::getChildren (vector<TestNode*>& res)
 {
        res.clear();
        for (int i = 0; i < (int)m_children.size(); i++)
@@ -87,6 +87,13 @@ void TestNode::addChild (TestNode* node)
        }
 #endif
 
+       // children only in group nodes
+       DE_ASSERT(getTestNodeTypeClass(m_nodeType) == NODECLASS_GROUP);
+
+       // children must have the same class
+       if (!m_children.empty())
+               DE_ASSERT(getTestNodeTypeClass(m_children.front()->getNodeType()) == getTestNodeTypeClass(node->getNodeType()));
+
        m_children.push_back(node);
 }