From c910c4cc5cde77b7ef034c50058d8d5f11bd4b71 Mon Sep 17 00:00:00 2001 From: Bastiaan Bakker Date: Sun, 22 Apr 2001 22:09:57 +0000 Subject: Merged extension headers back in from Micheal Feathers version. --- include/cppunit/extensions/TestDecorator.h | 67 ++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 include/cppunit/extensions/TestDecorator.h (limited to 'include/cppunit/extensions/TestDecorator.h') diff --git a/include/cppunit/extensions/TestDecorator.h b/include/cppunit/extensions/TestDecorator.h new file mode 100644 index 0000000..54494f3 --- /dev/null +++ b/include/cppunit/extensions/TestDecorator.h @@ -0,0 +1,67 @@ + + +#ifndef CPPUNIT_TESTDECORATOR_H +#define CPPUNIT_TESTDECORATOR_H + +#ifndef CPPUNIT_TEST_H +#include "../Test.h" +#endif + +namespace CppUnit { + +class TestResult; + +/* + * A Decorator for Tests + * + * Does not assume ownership of the test it decorates + * + */ + +class TestDecorator : public Test +{ +public: + TestDecorator (Test *test); + ~TestDecorator (); + + int countTestCases () const; + void run (TestResult *result) const; + std::string toString () const; + std::string getName () const; + +protected: + Test *m_test; + +private: + TestDecorator( const TestDecorator &); + void operator =( const TestDecorator & ); +}; + + +inline TestDecorator::TestDecorator (Test *test) +{ m_test = test; } + + +inline TestDecorator::~TestDecorator () +{} + + +inline TestDecorator::countTestCases () const +{ return m_test->countTestCases (); } + + +inline void TestDecorator::run (TestResult *result) const +{ m_test->run (result); } + + +inline std::string TestDecorator::toString () const +{ return m_test->toString (); } + + +inline std::string TestDecorator::getName () const +{ return m_test->getName(); } + +} // namespace CppUnit + +#endif + -- cgit v1.2.1