From 0c550516dd99c384eb376c9b9a51f92b1cd19e1a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 24 Jan 2010 11:33:24 +0000 Subject: [PATCH] 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 --- tests/streams/sstream.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/tests/streams/sstream.cpp b/tests/streams/sstream.cpp index 2663609..4e58062 100644 --- a/tests/streams/sstream.cpp +++ b/tests/streams/sstream.cpp @@ -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() ); } -- 2.7.4