Ejemplo n.º 1
0
/// Deletes all tests in the suite.
void 
TestSuite::deleteContents()
{
  int childCount = getChildTestCount();
  for ( int index =0; index < childCount; ++index )
    delete getChildTestAt( index );

  m_tests.clear();
}
Ejemplo n.º 2
0
int
TestComposite::countTestCases() const
{
  int count = 0;

  int childCount = getChildTestCount();
  for ( int index =0; index < childCount; ++index )
    count += getChildTestAt( index )->countTestCases();

  return count;
}
Ejemplo n.º 3
0
void
TestComposite::doRunChildTests( TestResult *controller )
{
  int childCount = getChildTestCount();
  for ( int index =0; index < childCount; ++index )
  {
    if ( controller->shouldStop() )
      break;

    getChildTestAt( index )->run( controller );
  }
}
Ejemplo n.º 4
0
void TestList::tableCellTouched(TableView* table, TableViewCell* cell)
{
    if (_cellTouchEnabled)
    {
        auto index = cell->getIdx();
        if (_testCallbacks[index])
        {
            auto test = _testCallbacks[index]();
            if (test->getChildTestCount() > 0)
            {
                _tableOffset = table->getContentOffset();
                _shouldRestoreTableOffset = true;
                _cellTouchEnabled = false;
                test->setTestParent(this);
                test->runThisTest();
            }
            else
            {
                delete test;
            }
        }
    }
}