2004-11-22 00:00:19 -05:00
|
|
|
#include "wx/wxprec.h"
|
2006-05-28 11:06:14 -04:00
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
// need this to be able to use CPPUNIT_ASSERT_EQUAL with wxString objects
|
|
|
|
//
|
|
|
|
// NB: at least for VC7.1 the specialization must be done before cppunit
|
|
|
|
// headers inclusion as otherwise it's just ignored!
|
|
|
|
namespace CppUnit
|
|
|
|
{
|
|
|
|
|
|
|
|
template <typename T> struct assertion_traits;
|
|
|
|
|
|
|
|
template <>
|
|
|
|
struct assertion_traits<wxString>
|
|
|
|
{
|
|
|
|
static bool equal(const wxString& s1, const wxString& s2)
|
|
|
|
{
|
|
|
|
return s1 == s2;
|
|
|
|
}
|
|
|
|
|
|
|
|
static std::string toString(const wxString& s)
|
|
|
|
{
|
|
|
|
return std::string(s.mb_str());
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace CppUnit
|
|
|
|
|
2004-11-22 00:00:19 -05:00
|
|
|
#include "wx/cppunit.h"
|
2006-03-31 12:42:26 -05:00
|
|
|
|
|
|
|
// define wxHAVE_U_ESCAPE if the compiler supports \uxxxx character constants
|
|
|
|
#if (defined(__VISUALC__) && (__VISUALC__ >= 1300)) || \
|
|
|
|
(defined(__GNUC__) && (__GNUC__ >= 3))
|
|
|
|
#define wxHAVE_U_ESCAPE
|
|
|
|
#endif
|
|
|
|
|
2006-05-28 11:06:14 -04:00
|
|
|
#define CPPUNIT_ASSERT_STR_EQUAL(s1, s2) \
|
|
|
|
CPPUNIT_ASSERT_EQUAL( wxString(s1), wxString(s2) )
|
|
|
|
|