My Project
Loading...
Searching...
No Matches
TeeListener.h
Go to the documentation of this file.
1#ifndef __cxxtest__TeeListener_h__
2#define __cxxtest__TeeListener_h__
3
4//
5// A TeeListener notifies two "reular" TestListeners
6//
7
10
11namespace CxxTest
12{
14 {
15 public:
17 {
20 }
21
22 virtual ~TeeListener()
23 {
24 }
25
26 void setFirst( TestListener &first )
27 {
28 _first = &first;
29 }
30
31 void setSecond( TestListener &second )
32 {
33 _second = &second;
34 }
35
37 {
38 _first->enterWorld( d );
39 _second->enterWorld( d );
40 }
41
43 {
44 _first->enterSuite( d );
45 _second->enterSuite( d );
46 }
47
48 void enterTest( const TestDescription &d )
49 {
50 _first->enterTest( d );
51 _second->enterTest( d );
52 }
53
54 void trace( const char *file, unsigned line, const char *expression )
55 {
56 _first->trace( file, line, expression );
57 _second->trace( file, line, expression );
58 }
59
60 void warning( const char *file, unsigned line, const char *expression )
61 {
62 _first->warning( file, line, expression );
63 _second->warning( file, line, expression );
64 }
65
66 void failedTest( const char *file, unsigned line, const char *expression )
67 {
68 _first->failedTest( file, line, expression );
69 _second->failedTest( file, line, expression );
70 }
71
72 void failedAssert( const char *file, unsigned line, const char *expression )
73 {
74 _first->failedAssert( file, line, expression );
75 _second->failedAssert( file, line, expression );
76 }
77
78 void failedAssertEquals( const char *file, unsigned line,
79 const char *xStr, const char *yStr,
80 const char *x, const char *y )
81 {
82 _first->failedAssertEquals( file, line, xStr, yStr, x, y );
83 _second->failedAssertEquals( file, line, xStr, yStr, x, y );
84 }
85
86 void failedAssertSameData( const char *file, unsigned line,
87 const char *xStr, const char *yStr,
88 const char *sizeStr, const void *x,
89 const void *y, unsigned size )
90 {
91 _first->failedAssertSameData( file, line, xStr, yStr, sizeStr, x, y, size );
92 _second->failedAssertSameData( file, line, xStr, yStr, sizeStr, x, y, size );
93 }
94
95 void failedAssertDelta( const char *file, unsigned line,
96 const char *xStr, const char *yStr, const char *dStr,
97 const char *x, const char *y, const char *d )
98 {
99 _first->failedAssertDelta( file, line, xStr, yStr, dStr, x, y, d );
100 _second->failedAssertDelta( file, line, xStr, yStr, dStr, x, y, d );
101 }
102
103 void failedAssertDiffers( const char *file, unsigned line,
104 const char *xStr, const char *yStr,
105 const char *value )
106 {
107 _first->failedAssertDiffers( file, line, xStr, yStr, value );
108 _second->failedAssertDiffers( file, line, xStr, yStr, value );
109 }
110
111 void failedAssertLessThan( const char *file, unsigned line,
112 const char *xStr, const char *yStr,
113 const char *x, const char *y )
114 {
115 _first->failedAssertLessThan( file, line, xStr, yStr, x, y );
116 _second->failedAssertLessThan( file, line, xStr, yStr, x, y );
117 }
118
119 void failedAssertLessThanEquals( const char *file, unsigned line,
120 const char *xStr, const char *yStr,
121 const char *x, const char *y )
122 {
123 _first->failedAssertLessThanEquals( file, line, xStr, yStr, x, y );
124 _second->failedAssertLessThanEquals( file, line, xStr, yStr, x, y );
125 }
126
127 void failedAssertPredicate( const char *file, unsigned line,
128 const char *predicate, const char *xStr, const char *x )
129 {
130 _first->failedAssertPredicate( file, line, predicate, xStr, x );
131 _second->failedAssertPredicate( file, line, predicate, xStr, x );
132 }
133
134 void failedAssertRelation( const char *file, unsigned line,
135 const char *relation, const char *xStr, const char *yStr,
136 const char *x, const char *y )
137 {
138 _first->failedAssertRelation( file, line, relation, xStr, yStr, x, y );
139 _second->failedAssertRelation( file, line, relation, xStr, yStr, x, y );
140 }
141
142 void failedAssertThrows( const char *file, unsigned line,
143 const char *expression, const char *type,
144 bool otherThrown )
145 {
146 _first->failedAssertThrows( file, line, expression, type, otherThrown );
147 _second->failedAssertThrows( file, line, expression, type, otherThrown );
148 }
149
150 void failedAssertThrowsNot( const char *file, unsigned line,
151 const char *expression )
152 {
153 _first->failedAssertThrowsNot( file, line, expression );
154 _second->failedAssertThrowsNot( file, line, expression );
155 }
156
157 void leaveTest( const TestDescription &d )
158 {
159 _first->leaveTest(d);
160 _second->leaveTest(d);
161 }
162
164 {
165 _first->leaveSuite(d);
167 }
168
170 {
171 _first->leaveWorld(d);
173 }
174
175 private:
178 };
179};
180
181
182#endif // __cxxtest__TeeListener_h__
int size(const CanonicalForm &f, const Variable &v)
int size ( const CanonicalForm & f, const Variable & v )
Definition: cf_ops.cc:600
Variable x
Definition: cfModGcd.cc:4082
TestListener * _first
Definition: TeeListener.h:176
void failedAssertThrows(const char *file, unsigned line, const char *expression, const char *type, bool otherThrown)
Definition: TeeListener.h:142
void enterTest(const TestDescription &d)
Definition: TeeListener.h:48
void failedAssertThrowsNot(const char *file, unsigned line, const char *expression)
Definition: TeeListener.h:150
void failedAssertDiffers(const char *file, unsigned line, const char *xStr, const char *yStr, const char *value)
Definition: TeeListener.h:103
void failedAssertEquals(const char *file, unsigned line, const char *xStr, const char *yStr, const char *x, const char *y)
Definition: TeeListener.h:78
virtual ~TeeListener()
Definition: TeeListener.h:22
void warning(const char *file, unsigned line, const char *expression)
Definition: TeeListener.h:60
void failedAssertDelta(const char *file, unsigned line, const char *xStr, const char *yStr, const char *dStr, const char *x, const char *y, const char *d)
Definition: TeeListener.h:95
void failedAssert(const char *file, unsigned line, const char *expression)
Definition: TeeListener.h:72
void failedAssertSameData(const char *file, unsigned line, const char *xStr, const char *yStr, const char *sizeStr, const void *x, const void *y, unsigned size)
Definition: TeeListener.h:86
TestListener * _second
Definition: TeeListener.h:176
void setFirst(TestListener &first)
Definition: TeeListener.h:26
void leaveSuite(const SuiteDescription &d)
Definition: TeeListener.h:163
void leaveTest(const TestDescription &d)
Definition: TeeListener.h:157
void trace(const char *file, unsigned line, const char *expression)
Definition: TeeListener.h:54
void enterSuite(const SuiteDescription &d)
Definition: TeeListener.h:42
void leaveWorld(const WorldDescription &d)
Definition: TeeListener.h:169
void failedAssertLessThan(const char *file, unsigned line, const char *xStr, const char *yStr, const char *x, const char *y)
Definition: TeeListener.h:111
void enterWorld(const WorldDescription &d)
Definition: TeeListener.h:36
void failedAssertRelation(const char *file, unsigned line, const char *relation, const char *xStr, const char *yStr, const char *x, const char *y)
Definition: TeeListener.h:134
void failedAssertPredicate(const char *file, unsigned line, const char *predicate, const char *xStr, const char *x)
Definition: TeeListener.h:127
void failedTest(const char *file, unsigned line, const char *expression)
Definition: TeeListener.h:66
TestListener _dummy
Definition: TeeListener.h:177
void setSecond(TestListener &second)
Definition: TeeListener.h:31
void failedAssertLessThanEquals(const char *file, unsigned line, const char *xStr, const char *yStr, const char *x, const char *y)
Definition: TeeListener.h:119
virtual void failedAssertLessThanEquals(const char *, unsigned, const char *, const char *, const char *, const char *)
Definition: TestListener.h:51
virtual void failedAssertDiffers(const char *, unsigned, const char *, const char *, const char *)
Definition: TestListener.h:45
virtual void failedAssertEquals(const char *, unsigned, const char *, const char *, const char *, const char *)
Definition: TestListener.h:34
virtual void trace(const char *, unsigned, const char *)
Definition: TestListener.h:26
virtual void leaveTest(const TestDescription &)
Definition: TestListener.h:64
virtual void failedAssertLessThan(const char *, unsigned, const char *, const char *, const char *, const char *)
Definition: TestListener.h:48
virtual void failedAssert(const char *, unsigned, const char *)
Definition: TestListener.h:32
virtual void failedAssertDelta(const char *, unsigned, const char *, const char *, const char *, const char *, const char *, const char *)
Definition: TestListener.h:41
virtual void failedAssertRelation(const char *, unsigned, const char *, const char *, const char *, const char *, const char *)
Definition: TestListener.h:56
virtual void failedTest(const char *, unsigned, const char *)
Definition: TestListener.h:30
virtual void failedAssertThrowsNot(const char *, unsigned, const char *)
Definition: TestListener.h:62
virtual void failedAssertThrows(const char *, unsigned, const char *, const char *, bool)
Definition: TestListener.h:59
virtual void enterWorld(const WorldDescription &)
Definition: TestListener.h:23
virtual void warning(const char *, unsigned, const char *)
Definition: TestListener.h:28
virtual void leaveWorld(const WorldDescription &)
Definition: TestListener.h:66
virtual void leaveSuite(const SuiteDescription &)
Definition: TestListener.h:65
virtual void failedAssertPredicate(const char *, unsigned, const char *, const char *, const char *)
Definition: TestListener.h:54
virtual void failedAssertSameData(const char *, unsigned, const char *, const char *, const char *, const void *, const void *, unsigned)
Definition: TestListener.h:37
virtual void enterSuite(const SuiteDescription &)
Definition: TestListener.h:24
virtual void enterTest(const TestDescription &)
Definition: TestListener.h:25
const CanonicalForm int const CFList const Variable & y
Definition: facAbsFact.cc:53