Fix wxString unit test when not using UTF-8.
Restrict the tests added in r70987 to run when using UTF-8 strings only, they test for something that is simply not true (and for a bug that can't happen) with non-multibyte encodings. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71384 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -192,10 +192,16 @@ void StringTestCase::Constructors()
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL( 0, wxString(wxString(), 17).length() );
|
||||
|
||||
// This string has 3 characters (<h>, <e'> and <l>), not 4!
|
||||
wxString s3("h\xc3\xa9llo", 4);
|
||||
CPPUNIT_ASSERT_EQUAL( 3, s3.length() );
|
||||
CPPUNIT_ASSERT_EQUAL( 'l', (char)s3[2] );
|
||||
#if wxUSE_UNICODE_UTF8
|
||||
// This string has 3 characters (<h>, <e'> and <l>), not 4 when using UTF-8
|
||||
// locale!
|
||||
if ( wxConvLibc.IsUTF8() )
|
||||
{
|
||||
wxString s3("h\xc3\xa9llo", 4);
|
||||
CPPUNIT_ASSERT_EQUAL( 3, s3.length() );
|
||||
CPPUNIT_ASSERT_EQUAL( 'l', (char)s3[2] );
|
||||
}
|
||||
#endif // wxUSE_UNICODE_UTF8
|
||||
|
||||
|
||||
static const char *s = "?really!";
|
||||
|
Reference in New Issue
Block a user