CppUnit project page | FAQ | CppUnit home page |
Functions | |
void CPPUNIT_API | fail (std::string message, SourceLine sourceLine=SourceLine()) |
void CPPUNIT_API | failIf (bool shouldFail, std::string message, SourceLine sourceLine=SourceLine()) |
void CPPUNIT_API | failNotEqual (std::string expected, std::string actual, SourceLine sourceLine=SourceLine(), std::string additionalMessage="") |
void CPPUNIT_API | failNotEqualIf (bool shouldFail, std::string expected, std::string actual, SourceLine sourceLine=SourceLine(), std::string additionalMessage="") |
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() )
|
Throws a Exception with the specified message and location. |
|
Throws a Exception with the specified message and location.
|
|
Throws a NotEqualException with the specified message and location.
|
|
Throws a NotEqualException with the specified message and location.
|
hosts this site. |
Send comments to: CppUnit Developers |