summaryrefslogtreecommitdiff
path: root/include/cppunit/extensions
diff options
context:
space:
mode:
Diffstat (limited to 'include/cppunit/extensions')
-rw-r--r--include/cppunit/extensions/HelperMacros.h14
-rw-r--r--include/cppunit/extensions/TestDecorator.h24
2 files changed, 25 insertions, 13 deletions
diff --git a/include/cppunit/extensions/HelperMacros.h b/include/cppunit/extensions/HelperMacros.h
index 142cd1d..c7be1aa 100644
--- a/include/cppunit/extensions/HelperMacros.h
+++ b/include/cppunit/extensions/HelperMacros.h
@@ -259,16 +259,8 @@ namespace CppUnit
/** @}
*/
-#define __CPPUNIT_CONCATENATE_DIRECT( s1, s2 ) s1##s2
-#define __CPPUNIT_CONCATENATE( s1, s2 ) __CPPUNIT_CONCATENATE_DIRECT( s1, s2 )
-/** Decorates the specified string with the line number to obtain a unique name;
- * @param str String to decorate.
- */
-#define __CPPUNIT_MAKE_UNIQUE_NAME( str ) __CPPUNIT_CONCATENATE( str, __LINE__ )
-
-
-/** Adds the specified fixture suite to the unnamed registry.
+/*! Adds the specified fixture suite to the unnamed registry.
* \ingroup CreatingTestSuite
*
* This macro declares a static variable whose construction
@@ -285,7 +277,7 @@ namespace CppUnit
*/
#define CPPUNIT_TEST_SUITE_REGISTRATION( ATestFixtureType ) \
static CppUnit::AutoRegisterSuite< ATestFixtureType > \
- __CPPUNIT_MAKE_UNIQUE_NAME(__autoRegisterSuite )
+ CPPUNIT_MAKE_UNIQUE_NAME(__autoRegisterSuite )
/** Adds the specified fixture suite to the specified registry suite.
@@ -325,7 +317,7 @@ namespace CppUnit
*/
#define CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( ATestFixtureType, suiteName ) \
static CppUnit::AutoRegisterSuite< ATestFixtureType > \
- __CPPUNIT_MAKE_UNIQUE_NAME(__autoRegisterSuite )(suiteName)
+ CPPUNIT_MAKE_UNIQUE_NAME(__autoRegisterSuite )(suiteName)
// Backwards compatibility
diff --git a/include/cppunit/extensions/TestDecorator.h b/include/cppunit/extensions/TestDecorator.h
index 9777540..bceca07 100644
--- a/include/cppunit/extensions/TestDecorator.h
+++ b/include/cppunit/extensions/TestDecorator.h
@@ -2,7 +2,7 @@
#define CPPUNIT_EXTENSIONS_TESTDECORATOR_H
#include <cppunit/Portability.h>
-#include <cppunit/TestLeaf.h>
+#include <cppunit/Test.h>
namespace CppUnit {
@@ -17,17 +17,23 @@ class TestResult;
*
* Does not assume ownership of the test it decorates
*/
-class CPPUNIT_API TestDecorator : public TestLeaf
+class CPPUNIT_API TestDecorator : public Test
{
public:
TestDecorator( Test *test );
~TestDecorator();
int countTestCases() const;
+
std::string getName() const;
+
void run( TestResult *result );
+ int getChildTestCount() const;
+
protected:
+ Test *doGetChildTestAt( int index ) const;
+
Test *m_test;
private:
@@ -69,6 +75,20 @@ TestDecorator::getName() const
return m_test->getName();
}
+
+inline int
+TestDecorator::getChildTestCount() const
+{
+ return m_test->getChildTestCount();
+}
+
+
+inline Test *
+TestDecorator::doGetChildTestAt( int index ) const
+{
+ return m_test->getChildTestAt( index );
+}
+
} // namespace CppUnit
#endif