diff options
| author | Baptiste Lepilleur <gaiacrtn@free.fr> | 2002-07-10 17:50:02 +0000 |
|---|---|---|
| committer | Baptiste Lepilleur <gaiacrtn@free.fr> | 2002-07-10 17:50:02 +0000 |
| commit | 85aa074c02154107459755b2a3ddbc0b5767558a (patch) | |
| tree | f48da462642cd10a74cc836a241b4b8fede53319 /include/cppunit | |
| parent | ad45759ab7a47c7a7932f7e6be66f3ea106b643b (diff) | |
| download | cppunit-85aa074c02154107459755b2a3ddbc0b5767558a.tar.gz | |
Include/cppunit/extensions/AutoRegisterSuite.
include/cppunit/extensions/AutoRegisterSuite.h:
* include/cppunit/extensions/Orthodox.h:
* include/cppunit/extensions/TestSuiteBuilder.h:
* include/cppunit/extensions/TestSuiteFactory.h:
* include/cppunit/TestCaller.h:
* examples/hierarchy/BoardGameTest.h:
* examples/hierarchy/ChessTest.h: replaced usage of 'typename' in template
declaration with 'class'.
* include/cppunit/ui/text/TestRunner.h:
* src/cppunit/TextTestRunner.cpp: updated to use the generic TestRunner.
Removed methods runTestByName() and runTest(). Inherits
CppUnit::TestRunner.
* include/cppunit/extensions/TestSuiteBuilder.h: removed templatized method
addTestCallerForException(). It is no longer used since release 1.9.8.
* examples/cppunittest/MockTestCase.h
* examples/cppunittest/MockTestCase.cpp: removed the usage of 'mutable'
keyword.
Diffstat (limited to 'include/cppunit')
| -rw-r--r-- | include/cppunit/TestCaller.h | 6 | ||||
| -rw-r--r-- | include/cppunit/TestRunner.h | 2 | ||||
| -rw-r--r-- | include/cppunit/extensions/AutoRegisterSuite.h | 2 | ||||
| -rw-r--r-- | include/cppunit/extensions/Orthodox.h | 6 | ||||
| -rw-r--r-- | include/cppunit/extensions/TestSuiteBuilder.h | 16 | ||||
| -rw-r--r-- | include/cppunit/extensions/TestSuiteFactory.h | 2 | ||||
| -rw-r--r-- | include/cppunit/ui/text/TestRunner.h | 17 |
7 files changed, 18 insertions, 33 deletions
diff --git a/include/cppunit/TestCaller.h b/include/cppunit/TestCaller.h index 3b10985..481aec6 100644 --- a/include/cppunit/TestCaller.h +++ b/include/cppunit/TestCaller.h @@ -27,7 +27,7 @@ private: * * This class is an implementation detail. You should never use this class directly. */ -template<typename ExceptionType> +template<class ExceptionType> struct ExpectedExceptionTraits { static void expectedException() @@ -98,8 +98,8 @@ struct ExpectedExceptionTraits<NoExceptionExpected> * \see TestCase */ -template <typename Fixture, - typename ExpectedException = NoExceptionExpected> +template <class Fixture, + class ExpectedException = NoExceptionExpected> class TestCaller : public TestCase { typedef void (Fixture::*TestMethod)(); diff --git a/include/cppunit/TestRunner.h b/include/cppunit/TestRunner.h index 7c7073e..b6c539c 100644 --- a/include/cppunit/TestRunner.h +++ b/include/cppunit/TestRunner.h @@ -102,7 +102,7 @@ protected: int getChildTestCount() const; - std::string getName () const; + std::string getName() const; void run( TestResult *result ); diff --git a/include/cppunit/extensions/AutoRegisterSuite.h b/include/cppunit/extensions/AutoRegisterSuite.h index ccf6997..24c2f2c 100644 --- a/include/cppunit/extensions/AutoRegisterSuite.h +++ b/include/cppunit/extensions/AutoRegisterSuite.h @@ -23,7 +23,7 @@ namespace CppUnit { * \see CPPUNIT_TEST_SUITE_REGISTRATION, CPPUNIT_TEST_SUITE_NAMED_REGISTRATION * \see CppUnit::TestFactoryRegistry. */ -template<typename TestCaseType> +template<class TestCaseType> class AutoRegisterSuite { public: diff --git a/include/cppunit/extensions/Orthodox.h b/include/cppunit/extensions/Orthodox.h index 5fc7aab..08c6dd1 100644 --- a/include/cppunit/extensions/Orthodox.h +++ b/include/cppunit/extensions/Orthodox.h @@ -38,7 +38,7 @@ namespace CppUnit { */ -template <typename ClassUnderTest> class Orthodox : public TestCase +template <class ClassUnderTest> class Orthodox : public TestCase { public: Orthodox () : TestCase ("Orthodox") {} @@ -52,7 +52,7 @@ protected: // Run an orthodoxy test -template <typename ClassUnderTest> void Orthodox<ClassUnderTest>::runTest () +template <class ClassUnderTest> void Orthodox<ClassUnderTest>::runTest () { // make sure we have a default constructor ClassUnderTest a, b, c; @@ -82,7 +82,7 @@ template <typename ClassUnderTest> void Orthodox<ClassUnderTest>::runTest () // Exercise a call -template <typename ClassUnderTest> +template <class ClassUnderTest> ClassUnderTest Orthodox<ClassUnderTest>::call (ClassUnderTest object) { return object; diff --git a/include/cppunit/extensions/TestSuiteBuilder.h b/include/cppunit/extensions/TestSuiteBuilder.h index f75e430..ae1c6df 100644 --- a/include/cppunit/extensions/TestSuiteBuilder.h +++ b/include/cppunit/extensions/TestSuiteBuilder.h @@ -19,7 +19,7 @@ namespace CppUnit { * MyTestSuiteName.myTestName * \see TestNamer. */ -template<typename Fixture> +template<class Fixture> class TestSuiteBuilder { public: @@ -74,20 +74,6 @@ public: addTest( test ); } - template<typename ExceptionType> - void addTestCallerForException( std::string methodName, - TestMethod testMethod, - Fixture *fixture, - ExceptionType *dummyPointer ) - { - Test *test = new TestCaller<Fixture,ExceptionType>( - makeTestName( methodName ), - testMethod, - fixture); - addTest( test ); - } - - std::string makeTestName( const std::string &methodName ) { return m_testNamer.getTestNameFor( methodName ); diff --git a/include/cppunit/extensions/TestSuiteFactory.h b/include/cppunit/extensions/TestSuiteFactory.h index 567812d..11605a5 100644 --- a/include/cppunit/extensions/TestSuiteFactory.h +++ b/include/cppunit/extensions/TestSuiteFactory.h @@ -10,7 +10,7 @@ namespace CppUnit { /*! \brief TestFactory for TestFixture that implements a static suite() method. * \see AutoRegisterSuite. */ - template<typename TestCaseType> + template<class TestCaseType> class TestSuiteFactory : public TestFactory { public: diff --git a/include/cppunit/ui/text/TestRunner.h b/include/cppunit/ui/text/TestRunner.h index d6244ee..93c7352 100644 --- a/include/cppunit/ui/text/TestRunner.h +++ b/include/cppunit/ui/text/TestRunner.h @@ -1,9 +1,12 @@ #ifndef CPPUNIT_UI_TEXT_TESTRUNNER_H #define CPPUNIT_UI_TEXT_TESTRUNNER_H +// Notes: this class is implemented in TextTestRunner.cpp. + #include <cppunit/Portability.h> #include <string> #include <vector> +#include <cppunit/TestRunner.h> namespace CppUnit { @@ -59,20 +62,21 @@ namespace TextUi * * \see CompilerOutputter, XmlOutputter, TextOutputter. */ -class CPPUNIT_API TestRunner +class CPPUNIT_API TestRunner : public CppUnit::TestRunner { public: + // Work around VC++ bug (class has same name as parent) + typedef CppUnit::TestRunner SuperClass; + TestRunner( Outputter *outputter =NULL ); virtual ~TestRunner(); - bool run( std::string testName ="", + bool run( std::string testPath ="", bool doWait = false, bool doPrintResult = true, bool doPrintProgress = true ); - void addTest( Test *test ); - void setOutputter( Outputter *outputter ); TestResultCollector &result() const; @@ -80,14 +84,9 @@ public: TestResult &eventManager() const; protected: - virtual bool runTest( Test *test, - bool doPrintProgress ); - virtual bool runTestByName( std::string testName, - bool printProgress ); virtual void wait( bool doWait ); virtual void printResult( bool doPrintResult ); - TestSuite *m_suite; TestResultCollector *m_result; TestResult *m_eventManager; Outputter *m_outputter; |
