summaryrefslogtreecommitdiff
path: root/examples/cppunittest/TestCallerTest.h
blob: e3177163d8c8c79a738115f30f2978c206059b34 (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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#ifndef TESTCALLERTEST_H
#define TESTCALLERTEST_H

#include <cppunit/TestCase.h>
#include <cppunit/TestSuite.h>
#include "TrackedTestCase.h"


class TestCallerTest : public CppUnit::TestCase, 
                              Tracker
{
public:
  TestCallerTest();
  virtual ~TestCallerTest();

  static CppUnit::TestSuite *suite();

  virtual void setUp();
  virtual void tearDown();

  void testBasicConstructor();
  void testReferenceConstructor();
  void testPointerConstructor();

  void testExpectFailureException();
  void testExpectException();

private:
  class ExceptionThrower : public CppUnit::TestCase
  {
  public:
    void testThrowFailureException();
    void testThrowException();
  };

  virtual void onConstructor();
  virtual void onDestructor();
  virtual void onSetUp();
  virtual void onTearDown();
  virtual void onTest();

  void checkNothingButConstructorCalled();
  void checkRunningSequenceCalled();
  void checkTestName( std::string testName );

  TestCallerTest( const TestCallerTest &copy );
  void operator =( const TestCallerTest &copy );

private:
  int m_constructorCount;
  int m_destructorCount;
  int m_setUpCount;
  int m_tearDownCount;
  int m_testCount;
  const std::string m_testName;
};



// Inlines methods for TestCallerTest:
// -----------------------------------



#endif  // TESTCALLERTEST_H