~ubuntu-branches/ubuntu/oneiric/psi/oneiric

« 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: 2009-09-25 17:49:51 UTC
  • mfrom: (6.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20090925174951-lvm7kdap82o8xhn3
Tags: 0.13-1
* Updated to upstream version 0.13
* Set Standards-Version to 3.8.3

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