本文整理汇总了C++中TestSuite::name方法的典型用法代码示例。如果您正苦于以下问题:C++ TestSuite::name方法的具体用法?C++ TestSuite::name怎么用?C++ TestSuite::name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestSuite
的用法示例。
在下文中一共展示了TestSuite::name方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onListTestsFinished
void TestListView::onListTestsFinished(void) {
// sanity check
Q_ASSERT_X(m_runner, Q_FUNC_INFO, "null test runner");
if ( m_runner == 0 )
return;
// clear any previous data (necessary here?)
clear();
// foreach program
const int numPrograms = m_runner->programCount();
for ( int i = 0; i < numPrograms; ++i ) {
TestProgram* program = m_runner->programAt(i);
Q_ASSERT_X(program, Q_FUNC_INFO, "null test program");
// create top-level item for program
QTreeWidgetItem* programItem = new QTreeWidgetItem;
programItem->setData(0, Qt::DisplayRole, program->programName());
programItem->setData(0, Qt::UserRole, QVariant::fromValue(program));
// programItem->setCheckState(0, Qt::Checked);
// foreach test suite
const int numSuites = program->suiteCount();
for ( int j = 0; j < numSuites; ++j ) {
TestSuite* suite = program->suiteAt(j);
Q_ASSERT_X(suite, Q_FUNC_INFO, "null test suite");
// create item for suite
QTreeWidgetItem* suiteItem = new QTreeWidgetItem(programItem);
suiteItem->setData(0, Qt::DisplayRole, suite->name());
suiteItem->setData(0, Qt::UserRole, QVariant::fromValue(suite));
// suiteItem->setCheckState(0, Qt::Checked);
// foreach test case
const int numTests = suite->testCount();
for ( int k = 0; k < numTests; ++k ) {
TestCase* test = suite->testAt(k);
Q_ASSERT_X(test, Q_FUNC_INFO, "null test case");
// create item for test
QTreeWidgetItem* testItem = new QTreeWidgetItem(suiteItem);
testItem->setData(0, Qt::DisplayRole, test->name());
testItem->setData(0, Qt::UserRole, QVariant::fromValue(test));
// testItem->setCheckState(0, Qt::Checked);
}
}
// add program item to table
addTopLevelItem(programItem);
}
// start with all items collapsed
collapseAll();
}