diff options
Diffstat (limited to 'examples/cppunittest/FailingTestCase.h')
-rw-r--r-- | examples/cppunittest/FailingTestCase.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/examples/cppunittest/FailingTestCase.h b/examples/cppunittest/FailingTestCase.h new file mode 100644 index 0000000..2ac52b5 --- /dev/null +++ b/examples/cppunittest/FailingTestCase.h @@ -0,0 +1,42 @@ +#ifndef FAILINGTESTCASE_H +#define FAILINGTESTCASE_H + +#include <cppunit/TestCase.h> +#include "FailureException.h" + + +class FailingTestCase : public CppUnit::TestCase +{ +public: + FailingTestCase( bool failSetUp =false, + bool failRunTest =false, + bool failTearDown =false ); + + virtual ~FailingTestCase(); + + virtual void setUp(); + virtual void tearDown(); + + virtual void runTest(); + + void verify( bool runTestCalled =true, + bool tearDownCalled =true); + +private: + FailingTestCase( const FailingTestCase © ); + void operator =( const FailingTestCase © ); + + void doFailure( bool shouldFail ); + +private: + bool m_failSetUp; + bool m_failRunTest; + bool m_failTearDown; + + bool m_setUpCalled; + bool m_runTestCalled; + bool m_tearDownCalled; +}; + + +#endif // FAILINGTESTCASE_H |