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:
1 #include <cppunit/SourceLine.h>
2 #include <cppunit/TestAssert.h>
5 checkXmlEqual( std::string expectedXml,
7 CppUnit::SourceLine sourceLine )
9 std::string expected = XmlUniformiser( expectedXml ).stripped();
10 std::string actual = XmlUniformiser( actualXml ).stripped();
12 if ( expected == actual )
15 ::CppUnit::Asserter::failNotEqual( expected,
20 /// Asserts that two XML strings are equivalent.
21 #define CPPUNITTEST_ASSERT_XML_EQUAL( expected, actual ) \
22 checkXmlEqual( expected, actual, \
23 CPPUNIT_SOURCELINE() )