X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a9f3fb07a0fd25c4769e92a7b871f497ef523a07..e02ea2030c4ee8c2d01c5823e2dc3d1ba7837acf:/tests/file/filetest.cpp diff --git a/tests/file/filetest.cpp b/tests/file/filetest.cpp index 446a59fa8d..4ee972b8b7 100644 --- a/tests/file/filetest.cpp +++ b/tests/file/filetest.cpp @@ -71,7 +71,8 @@ void FileTestCase::DoRoundTripTest(const wxMBConv& conv) { TestFile tf; - const wxString data = "Hello\0UTF"; + // Explicit length is needed because of the embedded NUL. + const wxString data("Hello\0UTF!", 10); { wxFile fout(tf.GetName(), wxFile::write); @@ -88,8 +89,8 @@ void FileTestCase::DoRoundTripTest(const wxMBConv& conv) wxCharBuffer buf(len); CPPUNIT_ASSERT_EQUAL( len, fin.Read(buf.data(), len) ); - wxWCharBuffer wbuf(conv.cMB2WC(buf)); - CPPUNIT_ASSERT_EQUAL( data, wbuf ); + wxString dataReadBack(buf, conv, len); + CPPUNIT_ASSERT_EQUAL( data, dataReadBack ); } }