summaryrefslogtreecommitdiff
path: root/examples/cppunittest/FailingTestCase.h
blob: 2ac52b5cc7b6d4fb855dfe45116d396668c07296 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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 &copy );
  void operator =( const FailingTestCase &copy );

  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