CppUnit project page | FAQ | CppUnit home page |
Traits used by CPPUNIT_ASSERT_EQUAL(). More...
#include <TestAssert.h>
Static Public Member Functions | |
static bool | equal (const T &x, const T &y) |
static std::string | toString (const T &x) |
Traits used by CPPUNIT_ASSERT_EQUAL().
Here is an example of specialising these traits:
template<> struct assertion_traits<std::string> // specialization for the std::string type { static bool equal( const std::string& x, const std::string& y ) { return x == y; } static std::string toString( const std::string& x ) { std::string text = '"' + x + '"'; // adds quote around the string to see whitespace OStringStream ost; ost << text; return ost.str(); } };
static bool assertion_traits< T >::equal | ( | const T & | x, |
const T & | y | ||
) | [inline, static] |
static std::string assertion_traits< T >::toString | ( | const T & | x | ) | [inline, static] |
|
hosts this site. |
Send comments to: CppUnit Developers |