CppUnit project page FAQ

Asserter.h
Go to the documentation of this file.
1 #ifndef CPPUNIT_ASSERTER_H
2 #define CPPUNIT_ASSERTER_H
3 
5 #include <cppunit/SourceLine.h>
6 #include <string>
7 
9 
10 
11 class Message;
12 
13 
45 struct Asserter
46 {
49  static void CPPUNIT_API fail( const Message &message,
50  const SourceLine &sourceLine = SourceLine() );
51 
55  static void CPPUNIT_API fail( std::string message,
56  const SourceLine &sourceLine = SourceLine() );
57 
64  static void CPPUNIT_API failIf( bool shouldFail,
65  const Message &message,
66  const SourceLine &sourceLine = SourceLine() );
67 
75  static void CPPUNIT_API failIf( bool shouldFail,
76  std::string message,
77  const SourceLine &sourceLine = SourceLine() );
78 
88  static std::string CPPUNIT_API makeExpected( const std::string &expectedValue );
89 
99  static std::string CPPUNIT_API makeActual( const std::string &actualValue );
100 
101  static Message CPPUNIT_API makeNotEqualMessage( const std::string &expectedValue,
102  const std::string &actualValue,
103  const AdditionalMessage &additionalMessage = AdditionalMessage(),
104  const std::string &shortDescription = "equality assertion failed");
105 
114  static void CPPUNIT_API failNotEqual( std::string expected,
115  std::string actual,
116  const SourceLine &sourceLine,
117  const AdditionalMessage &additionalMessage = AdditionalMessage(),
118  std::string shortDescription = "equality assertion failed" );
119 
130  static void CPPUNIT_API failNotEqualIf( bool shouldFail,
131  std::string expected,
132  std::string actual,
133  const SourceLine &sourceLine,
134  const AdditionalMessage &additionalMessage = AdditionalMessage(),
135  std::string shortDescription = "equality assertion failed" );
136 
137 };
138 
139 
141 
142 
143 #endif // CPPUNIT_ASSERTER_H

Send comments to:
CppUnit Developers