1 #ifndef CPPUNIT_ASSERTER_H
2 #define CPPUNIT_ASSERTER_H
102 const std::string &actualValue,
104 const std::string &shortDescription =
"equality assertion failed");
118 std::string shortDescription =
"equality assertion failed" );
131 std::string expected,
135 std::string shortDescription =
"equality assertion failed" );
143 #endif // CPPUNIT_ASSERTER_H
A set of functions to help writing assertion macros.Here is an example of assertion, a simplified version of the actual assertion implemented in examples/cppunittest/XmlUniformiser.h:
Definition: Asserter.h:45
static void CPPUNIT_API failIf(bool shouldFail, const Message &message, const SourceLine &sourceLine=SourceLine())
Throws a Exception with the specified message and location.
Definition: Asserter.cpp:26
static void CPPUNIT_API fail(const Message &message, const SourceLine &sourceLine=SourceLine())
Throws a Exception with the specified message and location.
Definition: Asserter.cpp:18
An additional Message for assertions.Provides a implicit constructor that takes a single string...
Definition: AdditionalMessage.h:39
Represents a source line location.Used to capture the failure location in assertion.
Definition: SourceLine.h:30
static std::string CPPUNIT_API makeActual(const std::string &actualValue)
Returns an actual value string for a message. Typically used to create 'not equal' message...
Definition: Asserter.cpp:52
static void CPPUNIT_API failNotEqual(std::string expected, std::string actual, const SourceLine &sourceLine, const AdditionalMessage &additionalMessage=AdditionalMessage(), std::string shortDescription="equality assertion failed")
Throws an Exception with the specified message and location.
Definition: Asserter.cpp:74
#define CPPUNIT_NS_END
Definition: Portability.h:120
#define CPPUNIT_NS_BEGIN
Definition: Portability.h:119
static std::string CPPUNIT_API makeExpected(const std::string &expectedValue)
Returns a expected value string for a message. Typically used to create 'not equal' message...
Definition: Asserter.cpp:45
Message associated to an Exception.A message is composed of two items:
Definition: Message.h:38
static void CPPUNIT_API failNotEqualIf(bool shouldFail, std::string expected, std::string actual, const SourceLine &sourceLine, const AdditionalMessage &additionalMessage=AdditionalMessage(), std::string shortDescription="equality assertion failed")
Throws an Exception with the specified message and location.
Definition: Asserter.cpp:89
static Message CPPUNIT_API makeNotEqualMessage(const std::string &expectedValue, const std::string &actualValue, const AdditionalMessage &additionalMessage=AdditionalMessage(), const std::string &shortDescription="equality assertion failed")
Definition: Asserter.cpp:59
#define CPPUNIT_API
Definition: CppUnitApi.h:27