~clint-fewbar/ubuntu/precise/squid3/ignore-sighup-early

« back to all changes in this revision

Viewing changes to lib/cppunit-1.10.0/examples/cppunittest/MockTestListener.h

  • Committer: Bazaar Package Importer
  • Author(s): Luigi Gangitano
  • Date: 2006-11-11 10:32:06 UTC
  • Revision ID: james.westby@ubuntu.com-20061111103206-f3p0r9g0vq44rp3r
Tags: upstream-3.0.PRE5
ImportĀ upstreamĀ versionĀ 3.0.PRE5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef MOCKTESTLISTENER_H
 
2
#define MOCKTESTLISTENER_H
 
3
 
 
4
#include <cppunit/TestListener.h>
 
5
#include <string>
 
6
 
 
7
 
 
8
class MockTestListener : public CPPUNIT_NS::TestListener
 
9
{
 
10
public:
 
11
  MockTestListener( std::string name );
 
12
  virtual ~MockTestListener() {}
 
13
 
 
14
  void setExpectFailure( CPPUNIT_NS::Test *failedTest,
 
15
                         CPPUNIT_NS::Exception *thrownException,
 
16
                         bool isError );
 
17
  void setExpectNoFailure();
 
18
  void setExpectFailure();
 
19
  void setExpectedAddFailureCall( int callCount );
 
20
  void setExpectStartTest( CPPUNIT_NS::Test *test );
 
21
  void setExpectedStartTestCall( int callCount );
 
22
  void setExpectEndTest( CPPUNIT_NS::Test *test );
 
23
  void setExpectedEndTestCall( int callCount );
 
24
  void setExpectStartSuite( CPPUNIT_NS::Test *suite );
 
25
  void setExpectedStartSuiteCall( int callCount );
 
26
  void setExpectEndSuite( CPPUNIT_NS::Test *suite );
 
27
  void setExpectedEndSuiteCall( int callCount );
 
28
  void setExpectStartTestRun( CPPUNIT_NS::Test *test,
 
29
                              CPPUNIT_NS::TestResult *eventManager );
 
30
  void setExpectedStartTestRunCall( int callCount );
 
31
  void setExpectEndTestRun( CPPUNIT_NS::Test *test,
 
32
                            CPPUNIT_NS::TestResult *eventManager );
 
33
  void setExpectedEndTestRunCall( int callCount );
 
34
 
 
35
  void addFailure( const CPPUNIT_NS::TestFailure &failure );
 
36
  void startTest( CPPUNIT_NS::Test *test );
 
37
  void endTest( CPPUNIT_NS::Test *test );
 
38
  void startSuite( CPPUNIT_NS::Test *suite );
 
39
  void endSuite( CPPUNIT_NS::Test *suite );
 
40
  void startTestRun( CPPUNIT_NS::Test *test, 
 
41
                     CPPUNIT_NS::TestResult *eventManager );
 
42
  void endTestRun( CPPUNIT_NS::Test *test, 
 
43
                   CPPUNIT_NS::TestResult *eventManager );
 
44
 
 
45
  void verify();
 
46
 
 
47
private:
 
48
  std::string m_name;
 
49
 
 
50
  bool m_hasExpectationForStartTest;
 
51
  bool m_hasParametersExpectationForStartTest;
 
52
  int m_expectedStartTestCallCount;
 
53
  int m_startTestCall;
 
54
  CPPUNIT_NS::Test *m_expectedStartTest;
 
55
 
 
56
  bool m_hasExpectationForEndTest;
 
57
  bool m_hasParametersExpectationForEndTest;
 
58
  int m_expectedEndTestCallCount;
 
59
  CPPUNIT_NS::Test *m_expectedEndTest;
 
60
  int m_endTestCall;
 
61
 
 
62
  bool m_hasExpectationForStartSuite;
 
63
  bool m_hasParametersExpectationForStartSuite;
 
64
  int m_expectedStartSuiteCallCount;
 
65
  CPPUNIT_NS::Test *m_expectedStartSuite;
 
66
  int m_startSuiteCall;
 
67
 
 
68
  bool m_hasExpectationForEndSuite;
 
69
  bool m_hasParametersExpectationForEndSuite;
 
70
  int m_expectedEndSuiteCallCount;
 
71
  CPPUNIT_NS::Test *m_expectedEndSuite;
 
72
  int m_endSuiteCall;
 
73
 
 
74
  bool m_hasExpectationForStartTestRun;
 
75
  bool m_hasParametersExpectationForStartTestRun;
 
76
  int m_expectedStartTestRunCallCount;
 
77
  CPPUNIT_NS::Test *m_expectedStartTestRun;
 
78
  CPPUNIT_NS::TestResult *m_expectedStartTestRun2;
 
79
  int m_startTestRunCall;
 
80
 
 
81
  bool m_hasExpectationForEndTestRun;
 
82
  bool m_hasParametersExpectationForEndTestRun;
 
83
  int m_expectedEndTestRunCallCount;
 
84
  CPPUNIT_NS::Test *m_expectedEndTestRun;
 
85
  CPPUNIT_NS::TestResult *m_expectedEndTestRun2;
 
86
  int m_endTestRunCall;
 
87
 
 
88
  bool m_hasExpectationForAddFailure;
 
89
  bool m_hasExpectationForSomeFailure;
 
90
  bool m_hasParametersExpectationForAddFailure;
 
91
  int m_expectedAddFailureCallCount;
 
92
  int m_addFailureCall;
 
93
  CPPUNIT_NS::Test *m_expectedFailedTest;
 
94
  CPPUNIT_NS::Exception *m_expectedException;
 
95
  bool m_expectedIsError;
 
96
};
 
97
 
 
98
 
 
99
 
 
100
// Inlines methods for MockTestListener:
 
101
// -------------------------------------
 
102
 
 
103
 
 
104
 
 
105
#endif  // MOCKTESTLISTENER_H