X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/53e372c281e6780adc282d30e7e55c094e1b0e49..db7035e48a4ccc6265fa01949cb92db3c6b6c17f:/include/wx/cppunit.h diff --git a/include/wx/cppunit.h b/include/wx/cppunit.h index fc9d5cf084..7f1923332a 100644 --- a/include/wx/cppunit.h +++ b/include/wx/cppunit.h @@ -88,16 +88,22 @@ #define WX_ASSERT_SIZET_EQUAL(n, m) CPPUNIT_ASSERT_EQUAL(((size_t)n), m) /////////////////////////////////////////////////////////////////////////////// -// stream inserter for wxString -// +// define stream inserter for wxString if it's not defined in the main library, +// we need it to output the test failures involving wxString +#if !wxUSE_STD_IOSTREAM #include "wx/string.h" inline std::ostream& operator<<(std::ostream& o, const wxString& s) { - return o << (const char *)wxSafeConvertWX2MB(s); +#if wxUSE_UNICODE + return o << (const char *)wxSafeConvertWX2MB(s.wc_str()); +#else + return o << s.c_str(); +#endif } +#endif // !wxUSE_STD_IOSTREAM /////////////////////////////////////////////////////////////////////////////// // Some more compiler warning tweaking and auto linking.