本文整理汇总了C++中TestSuite::tests方法的典型用法代码示例。如果您正苦于以下问题:C++ TestSuite::tests方法的具体用法?C++ TestSuite::tests怎么用?C++ TestSuite::tests使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestSuite
的用法示例。
在下文中一共展示了TestSuite::tests方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: print
void TestRunner::print(const std::string& name, Test* pTest, int indent)
{
for (int i = 0; i < indent; ++i)
_ostr << " ";
_ostr << name << std::endl;
TestSuite* pSuite = dynamic_cast<TestSuite*>(pTest);
if (pSuite)
{
const std::vector<Test*>& tests = pSuite->tests();
for (std::vector<Test*>::const_iterator it = tests.begin(); it != tests.end(); ++it)
{
print((*it)->toString(), *it, indent + 1);
}
}
}
示例2: addTest
void TestRunnerDlg::addTest(Test* pTest, int level)
{
TestInfo ti;
ti.pTest = pTest;
ti.level = level;
_tests.push_back(ti);
TestSuite* pSuite = dynamic_cast<TestSuite*>(pTest);
if (pSuite)
{
const std::vector<Test*>& tests = pSuite->tests();
for (std::vector<Test*>::const_iterator it = tests.begin(); it != tests.end(); ++it)
{
addTest(*it, level + 1);
}
}
}
示例3: find
Test* TestRunner::find(const std::string& name, Test* pTest, const std::string& testName)
{
if (testName.find(name) != std::string::npos)
{
return pTest;
}
else
{
TestSuite* pSuite = dynamic_cast<TestSuite*>(pTest);
if (pSuite)
{
const std::vector<Test*>& tests = pSuite->tests();
for (std::vector<Test*>::const_iterator it = tests.begin(); it != tests.end(); ++it)
{
Test* result = find(name, *it, (*it)->toString());
if (result) return result;
}
}
return 0;
}
}