summaryrefslogtreecommitdiffstats
blob: 8dd2ea6e719d4909a91782f99cecfe4c5d8326ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#include <cppunit/config/SourcePrefix.h>
#include <cppunit/TestSuite.h>
#include <cppunit/TestResult.h>

CPPUNIT_NS_BEGIN


/// Default constructor
TestSuite::TestSuite( std::string name )
    : TestComposite( name )
{
}


/// Destructor
TestSuite::~TestSuite()
{ 
  deleteContents(); 
}


/// 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();
}


/// Adds a test to the suite. 
void 
TestSuite::addTest( Test *test )
{ 
  m_tests.push_back( test ); 
}


const CppUnitVector<Test *> &
TestSuite::getTests() const
{
  return m_tests;
}


int 
TestSuite::getChildTestCount() const
{
  return m_tests.size();
}


Test *
TestSuite::doGetChildTestAt( int index ) const
{
  return m_tests[index];
}


CPPUNIT_NS_END