Ejemplo n.º 1
0
void
TestPath::insert( const TestPath &path,
                  int index )
{
  int itemIndex = path.getTestCount() -1;
  while ( itemIndex >= 0 )
    insert( path.getTestAt( itemIndex-- ), index );
}
Ejemplo n.º 2
0
void 
TestRunner::run( TestResult &controller,
                 const std::string &testPath )
{
  TestPath path = m_suite->resolveTestPath( testPath );
  Test *testToRun = path.getChildTest();

  controller.runTest( testToRun );
}
Ejemplo n.º 3
0
Test *
Test::findTest( const std::string &testName ) const
{
  TestPath path;
  Test *mutableThis = CPPUNIT_CONST_CAST( Test *, this );
  mutableThis->findTestPath( testName, path );
  if ( !path.isValid() )
    throw std::invalid_argument( "No test named <" + testName + "> found in test <"
                                 + getName() + ">." );
  return path.getChildTest();
}
Ejemplo n.º 4
0
bool test()
{
  bool t1, t2, t3, t4;
  TestFile tf;
  t1 = tf.test();
  TestFileInfo tfi;
  t2 = tfi.test();
  TestPath tp;
  t3 = tp.test();
  TestDirectory td;
  t4 = td.test();
  return t1 && t2 && t3;
}
Ejemplo n.º 5
0
TestPath::TestPath( const TestPath &other,
                    int indexFirst,
                    int count )
{
  int countAdjustment = 0;
  if ( indexFirst < 0 )
  {
    countAdjustment = indexFirst;
    indexFirst = 0;
  }

  if ( count < 0 )
    count = other.getTestCount();
  else
    count += countAdjustment;

  int index = indexFirst;
  while ( count-- > 0  &&  index < other.getTestCount() )
    add( other.getTestAt( index++ ) );
}
Ejemplo n.º 6
0
 void runTest() { suite_TestPath.test_ctor(); }
Ejemplo n.º 7
0
void
TestPath::add( const TestPath &path )
{
  for ( int index =0; index < path.getTestCount(); ++index )
    add( path.getTestAt( index ) );
}