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:
Vadim Zeitlin
2012-05-09 14:24:10 +00:00
parent 30ee0b9764
commit 39d169639b

View File

@@ -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!";