CppUnit project page FAQ CppUnit home page

Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

Asserter.h

Go to the documentation of this file.
00001 #ifndef CPPUNIT_ASSERTER_H 00002 #define CPPUNIT_ASSERTER_H 00003 00004 #include <cppunit/AdditionalMessage.h> 00005 #include <cppunit/SourceLine.h> 00006 #include <string> 00007 00008 CPPUNIT_NS_BEGIN 00009 00010 00011 class Message; 00012 00013 00045 struct Asserter 00046 { 00049 static void CPPUNIT_API fail( const Message &message, 00050 const SourceLine &sourceLine = SourceLine() ); 00051 00055 static void CPPUNIT_API fail( std::string message, 00056 const SourceLine &sourceLine = SourceLine() ); 00057 00064 static void CPPUNIT_API failIf( bool shouldFail, 00065 const Message &message, 00066 const SourceLine &sourceLine = SourceLine() ); 00067 00075 static void CPPUNIT_API failIf( bool shouldFail, 00076 std::string message, 00077 const SourceLine &sourceLine = SourceLine() ); 00078 00088 static std::string CPPUNIT_API makeExpected( const std::string &expectedValue ); 00089 00099 static std::string CPPUNIT_API makeActual( const std::string &actualValue ); 00100 00101 static Message CPPUNIT_API makeNotEqualMessage( const std::string &expectedValue, 00102 const std::string &actualValue, 00103 const AdditionalMessage &additionalMessage = AdditionalMessage(), 00104 const std::string &shortDescription = "equality assertion failed"); 00105 00114 static void CPPUNIT_API failNotEqual( std::string expected, 00115 std::string actual, 00116 const SourceLine &sourceLine, 00117 const AdditionalMessage &additionalMessage = AdditionalMessage(), 00118 std::string shortDescription = "equality assertion failed" ); 00119 00130 static void CPPUNIT_API failNotEqualIf( bool shouldFail, 00131 std::string expected, 00132 std::string actual, 00133 const SourceLine &sourceLine, 00134 const AdditionalMessage &additionalMessage = AdditionalMessage(), 00135 std::string shortDescription = "equality assertion failed" ); 00136 00137 }; 00138 00139 00140 CPPUNIT_NS_END 00141 00142 00143 #endif // CPPUNIT_ASSERTER_H

SourceForge Logo hosts this site. Send comments to:
CppUnit Developers