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++)
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++)
}
#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);
}