Go to the documentation of this file. 1 #ifndef CPPUNIT_ASSERTER_H
2 #define CPPUNIT_ASSERTER_H
47 # define NORETURN __attribute__((noreturn))
151 const std::string &actualValue,
153 const std::string &shortDescription =
"equality assertion failed");
156 const std::string &actualValue,
157 const std::string &shortDescription,
172 std::string shortDescription =
"equality assertion failed" );
186 std::string shortDescription =
"less assertion failed" );
200 std::string shortDescription =
"greater assertion failed" );
214 std::string shortDescription =
"less equal assertion failed" );
228 std::string shortDescription =
"greater equal assertion failed" );
240 std::string expected,
244 std::string shortDescription =
"equality assertion failed" );
252 #endif // CPPUNIT_ASSERTER_H
#define CPPUNIT_API
Definition: CppUnitApi.h:27
#define NORETURN
A set of functions to help writing assertion macros.
Definition: Asserter.h:49
Represents a source line location.
Definition: SourceLine.h:30
static void CPPUNIT_API failNotLess(std::string expected, std::string actual, const SourceLine &sourceLine, const AdditionalMessage &additionalMessage=AdditionalMessage(), std::string shortDescription="less assertion failed")
Throws an Exception with the specified message and location.
Definition: Asserter.cpp:128
static std::string CPPUNIT_API makeExpectedLess(const std::string &expectedValue)
Returns a expected value string for a message, case less than.
Definition: Asserter.cpp:57
Definition: Asserter.h:52
static void CPPUNIT_API failNotGreaterEqual(std::string expected, std::string actual, const SourceLine &sourceLine, const AdditionalMessage &additionalMessage=AdditionalMessage(), std::string shortDescription="greater equal assertion failed")
Throws an Exception with the specified message and location.
Definition: Asserter.cpp:171
static NORETURN 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:113
static std::string CPPUNIT_API makeExpected(const std::string &expectedValue)
Returns a expected value string for a message, case equal than Typically used to create 'not equal' m...
Definition: Asserter.cpp: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:27
Message associated to an Exception.
Definition: Message.h:34
static std::string CPPUNIT_API makeExpectedLessEqual(const std::string &expectedValue)
Returns a expected value string for a message, case less or equal than.
Definition: Asserter.cpp:63
static std::string CPPUNIT_API makeExpectedGreaterEqual(const std::string &expectedValue)
Returns a expected value string for a message, greater or equal than.
Definition: Asserter.cpp:75
#define CPPUNIT_NS_BEGIN
Definition: Portability.h:105
#define CPPUNIT_NS_END
Definition: Portability.h:106
static std::string CPPUNIT_API makeExpectedGreater(const std::string &expectedValue)
Returns a expected value string for a message, case greater than.
Definition: Asserter.cpp:69
static NORETURN void CPPUNIT_API fail(const Message &message, const SourceLine &sourceLine=SourceLine())
Throws a Exception with the specified message and location.
Definition: Asserter.cpp:19
An additional Message for assertions.
Definition: AdditionalMessage.h:39
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:184
static void CPPUNIT_API failNotGreater(std::string expected, std::string actual, const SourceLine &sourceLine, const AdditionalMessage &additionalMessage=AdditionalMessage(), std::string shortDescription="greater assertion failed")
Throws an Exception with the specified message and location.
Definition: Asserter.cpp:143
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:103
static void CPPUNIT_API failNotLessEqual(std::string expected, std::string actual, const SourceLine &sourceLine, const AdditionalMessage &additionalMessage=AdditionalMessage(), std::string shortDescription="less equal assertion failed")
Throws an Exception with the specified message and location.
Definition: Asserter.cpp:157
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:81
static Message CPPUNIT_API makeMessage(const std::string &expectedValue, const std::string &actualValue, const std::string &shortDescription, const AdditionalMessage &additionalMessage=AdditionalMessage())
Definition: Asserter.cpp:88
static std::string CPPUNIT_API makeExpectedEqual(const std::string &expectedValue)
Returns a expected value string for a message, case equal than Typically used to create 'not equal' m...
Definition: Asserter.cpp:51