#endif
}
+// in case wcscmp is missing
+//
+static int wx_wcscmp(const wchar_t *s1, const wchar_t *s2)
+{
+ for (;;) {
+ if (*s1 != *s2)
+ return *s1 - *s2;
+ if (*s1 == 0)
+ break;
+ s1++;
+ s2++;
+ }
+ return 0;
+}
+
void
StringTestCase::DoTestConversion(const char *s,
const wchar_t *ws,
wxWCharBuffer wbuf(wxString(s).wc_str(conv));
if ( ws )
- CPPUNIT_ASSERT( wcscmp(wbuf, ws) == 0 );
+ CPPUNIT_ASSERT( wx_wcscmp(wbuf, ws) == 0 );
else
CPPUNIT_ASSERT( !*wbuf );
}
CPPUNIT_ASSERT( s == wxString(r,rlen) ); \
}
- TEST_WXREPLACE( _T("null\0char"), 9, _T("c"), _T("d"), true,
- _T("null\0dhar"), 9 );
+ TEST_WXREPLACE( _T("null\0char"), 9, _T("c"), _T("de"), true,
+ _T("null\0dehar"), 10 );
+
+ TEST_WXREPLACE( _T("null\0dehar"), 10, _T("de"), _T("c"), true,
+ _T("null\0char"), 9 );
#undef TEST_WXREPLACE
#undef TEST_NULLCHARREPLACE