CppUnit project page | FAQ |
Classes | |
class | AdditionalMessage |
An additional Message for assertions.Provides a implicit constructor that takes a single string. This allow this class to be used as the message arguments in macros. More... | |
class | Message |
Message associated to an Exception.A message is composed of two items:
| |
class | SourceLine |
Represents a source line location.Used to capture the failure location in assertion. More... | |
Defines | |
#define | NORETURN |
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:. | |
#define | CPPUNIT_SOURCELINE() CPPUNIT_NS::SourceLine( __FILE__, __LINE__ ) |
Constructs a SourceLine object initialized with the location where the macro is expanded. |
#define CPPUNIT_SOURCELINE | ( | ) | CPPUNIT_NS::SourceLine( __FILE__, __LINE__ ) |
Constructs a SourceLine object initialized with the location where the macro is expanded.
Used to write your own assertion macros.
#define NORETURN |
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:.
#include <cppunit/SourceLine.h> #include <cppunit/TestAssert.h> void checkXmlEqual( std::string expectedXml, std::string actualXml, CppUnit::SourceLine sourceLine ) { std::string expected = XmlUniformiser( expectedXml ).stripped(); std::string actual = XmlUniformiser( actualXml ).stripped(); if ( expected == actual ) return; ::CppUnit::Asserter::failNotEqual( expected, actual, sourceLine ); } #define CPPUNITTEST_ASSERT_XML_EQUAL( expected, actual ) \ checkXmlEqual( expected, actual, \ CPPUNIT_SOURCELINE() )
Send comments to: CppUnit Developers |