Fix bug in wxStringOutputStream unit test.

We wrote an extra NUL byte to the stream and, unsurprisingly, contents of its
buffer didn't match the original string resulting in the test failure.

Also get rid of a #if wxUSE_UNICODE.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63249 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2010-01-24 11:33:24 +00:00
parent 421f32d102
commit 0c550516dd

View File

@@ -106,14 +106,8 @@ void strStream::CheckString(const wxString& text)
{
wxStringOutputStream sos;
size_t len = text.length();
#if wxUSE_UNICODE
const wxCharBuffer textMB(wxConvLibc.cWC2MB(text.wc_str(), len + 1, &len));
#else
const char *textMB = text.c_str();
#endif
sos.Write(textMB, len);
const wxScopedCharBuffer buf(text.mb_str());
sos.Write(buf, buf.length());
CPPUNIT_ASSERT_EQUAL( text, sos.GetString() );
}