~ubuntu-branches/ubuntu/wily/psi/wily

« back to all changes in this revision

Viewing changes to third-party/cppunit/cppunit/src/cppunit/TestSuiteBuilderContext.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/TestSuite.h>
2
 
#include <cppunit/extensions/TestFixtureFactory.h>
3
 
#include <cppunit/extensions/TestNamer.h>
4
 
#include <cppunit/extensions/TestSuiteBuilderContext.h>
5
 
 
6
 
 
7
 
CPPUNIT_NS_BEGIN
8
 
 
9
 
TestSuiteBuilderContextBase::TestSuiteBuilderContextBase( 
10
 
                                 TestSuite &suite,
11
 
                                 const TestNamer &namer,
12
 
                                 TestFixtureFactory &factory )
13
 
  : m_suite( suite )
14
 
  , m_namer( namer )
15
 
  , m_factory( factory )
16
 
{
17
 
}
18
 
 
19
 
 
20
 
TestSuiteBuilderContextBase::~TestSuiteBuilderContextBase()
21
 
{
22
 
}
23
 
 
24
 
 
25
 
void 
26
 
TestSuiteBuilderContextBase::addTest( Test *test )
27
 
{
28
 
  m_suite.addTest( test );
29
 
}
30
 
 
31
 
 
32
 
std::string 
33
 
TestSuiteBuilderContextBase::getFixtureName() const
34
 
{
35
 
  return m_namer.getFixtureName();
36
 
}
37
 
 
38
 
 
39
 
std::string 
40
 
TestSuiteBuilderContextBase::getTestNameFor( 
41
 
                                 const std::string &testMethodName ) const
42
 
{
43
 
  return m_namer.getTestNameFor( testMethodName );
44
 
}
45
 
 
46
 
 
47
 
TestFixture *
48
 
TestSuiteBuilderContextBase::makeTestFixture() const
49
 
{
50
 
  return m_factory.makeFixture();
51
 
}
52
 
 
53
 
 
54
 
void 
55
 
TestSuiteBuilderContextBase::addProperty( const std::string &key, 
56
 
                                          const std::string &value )
57
 
{
58
 
  Properties::iterator it = m_properties.begin();
59
 
  for ( ; it != m_properties.end(); ++it )
60
 
  {
61
 
    if ( (*it).first == key )
62
 
    {
63
 
      (*it).second = value;
64
 
      return;
65
 
    }
66
 
  }
67
 
 
68
 
  Property property( key, value );
69
 
  m_properties.push_back( property );
70
 
}
71
 
 
72
 
const std::string 
73
 
TestSuiteBuilderContextBase::getStringProperty( const std::string &key ) const
74
 
{
75
 
  Properties::const_iterator it = m_properties.begin();
76
 
  for ( ; it != m_properties.end(); ++it )
77
 
  {
78
 
    if ( (*it).first == key )
79
 
      return (*it).second;
80
 
  }
81
 
  return "";
82
 
}
83
 
 
84
 
 
85
 
CPPUNIT_NS_END