~ubuntu-branches/ubuntu/vivid/psi/vivid

« back to all changes in this revision

Viewing changes to third-party/cppunit/cppunit/src/cppunit/TestSuite.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2008-08-28 18:46:52 UTC
  • mfrom: (1.2.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20080828184652-iiik12dl91nq7cdi
Tags: 0.12-2
Uploading to unstable (Closes: Bug#494352)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <cppunit/config/SourcePrefix.h>
 
2
#include <cppunit/TestSuite.h>
 
3
#include <cppunit/TestResult.h>
 
4
 
 
5
CPPUNIT_NS_BEGIN
 
6
 
 
7
 
 
8
/// Default constructor
 
9
TestSuite::TestSuite( std::string name )
 
10
    : TestComposite( name )
 
11
{
 
12
}
 
13
 
 
14
 
 
15
/// Destructor
 
16
TestSuite::~TestSuite()
 
17
 
18
  deleteContents(); 
 
19
}
 
20
 
 
21
 
 
22
/// Deletes all tests in the suite.
 
23
void 
 
24
TestSuite::deleteContents()
 
25
{
 
26
  int childCount = getChildTestCount();
 
27
  for ( int index =0; index < childCount; ++index )
 
28
    delete getChildTestAt( index );
 
29
 
 
30
  m_tests.clear();
 
31
}
 
32
 
 
33
 
 
34
/// Adds a test to the suite. 
 
35
void 
 
36
TestSuite::addTest( Test *test )
 
37
 
38
  m_tests.push_back( test ); 
 
39
}
 
40
 
 
41
 
 
42
const CppUnitVector<Test *> &
 
43
TestSuite::getTests() const
 
44
{
 
45
  return m_tests;
 
46
}
 
47
 
 
48
 
 
49
int 
 
50
TestSuite::getChildTestCount() const
 
51
{
 
52
  return m_tests.size();
 
53
}
 
54
 
 
55
 
 
56
Test *
 
57
TestSuite::doGetChildTestAt( int index ) const
 
58
{
 
59
  return m_tests[index];
 
60
}
 
61
 
 
62
 
 
63
CPPUNIT_NS_END
 
64