Imported Upstream version 2.81
[platform/upstream/libbullet.git] / UnitTests / cppunit / src / cppunit / TestNamer.cpp
1 #include <cppunit/extensions/TestNamer.h>
2 #include <cppunit/extensions/TypeInfoHelper.h>
3 #include <string>
4
5
6 CPPUNIT_NS_BEGIN
7
8
9 #if CPPUNIT_HAVE_RTTI
10 TestNamer::TestNamer( const std::type_info &typeInfo )
11 {
12   m_fixtureName = TypeInfoHelper::getClassName( typeInfo );
13 }
14 #endif
15
16
17 TestNamer::TestNamer( const std::string &fixtureName )
18   : m_fixtureName( fixtureName )
19 {
20 }
21
22
23 TestNamer::~TestNamer()
24 {
25 }
26
27
28 std::string 
29 TestNamer::getFixtureName() const
30 {
31   return m_fixtureName;
32 }
33
34
35 std::string 
36 TestNamer::getTestNameFor( const std::string &testMethodName ) const
37 {
38   return getFixtureName() + "::" + testMethodName;
39 }
40
41
42
43
44 CPPUNIT_NS_END