Disable unit tests which can't work in ANSI build.

Disable unit tests involving operations (such as conversions between UTF and
anything but plain ASCII) not available in ANSI build.

This fixes the test suite for non-Unicode build under Unix.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66103 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2010-11-10 13:53:49 +00:00
parent 716ee1223e
commit 87f528f15b
6 changed files with 20 additions and 0 deletions

View File

@ -17,6 +17,8 @@
#pragma hdrstop
#endif
#if wxUSE_UNICODE
#include "wx/convauto.h"
#include "wx/mstream.h"
@ -208,3 +210,5 @@ void ConvAutoTestCase::StreamUTF32BE()
"\0\0\x03\xB2",
20, line1, line2);
}
#endif // wxUSE_UNICODE

View File

@ -44,7 +44,9 @@ public:
private:
CPPUNIT_TEST_SUITE( CrtTestCase );
CPPUNIT_TEST( SetGetEnv );
#if wxUSE_UNICODE
CPPUNIT_TEST( Strchr );
#endif // wxUSE_UNICODE
CPPUNIT_TEST( Strcmp );
CPPUNIT_TEST( Strspn );
CPPUNIT_TEST( Strcspn );
@ -53,7 +55,9 @@ private:
CPPUNIT_TEST_SUITE_END();
void SetGetEnv();
#if wxUSE_UNICODE
void Strchr();
#endif // wxUSE_UNICODE
void Strcmp();
void Strspn();
void Strcspn();
@ -91,6 +95,7 @@ void CrtTestCase::SetGetEnv()
#undef TESTVAR_NAME
}
#if wxUSE_UNICODE
void CrtTestCase::Strchr()
{
// test that searching for a wide character in a narrow string simply
@ -103,6 +108,7 @@ void CrtTestCase::Strchr()
CPPUNIT_ASSERT( wxStrchr(wxString::FromUTF8(":-) == \xe2\x98\xba"),
static_cast<wchar_t>(smiley)) );
}
#endif // wxUSE_UNICODE
void CrtTestCase::Strcmp()
{

View File

@ -515,10 +515,12 @@ void StdStringTestCase::StdResize()
CPPUNIT_ASSERT_EQUAL( wxT("abcABCdefDEF "), s3 );
CPPUNIT_ASSERT_EQUAL( wxT("abcABCdefDEFWW"), s4 );
#if wxUSE_UNICODE
wxString s =
wxString::FromUTF8("\xd0\x9f\xd1\x80\xd0\xb8\xd0\xb2\xd0\xb5\xd1\x82");
s.resize(3);
CPPUNIT_ASSERT_EQUAL( wxString::FromUTF8("\xd0\x9f\xd1\x80\xd0\xb8"), s);
#endif // wxUSE_UNICODE
}
void StdStringTestCase::StdRiter()

View File

@ -38,7 +38,9 @@ private:
CPPUNIT_TEST( CharCompare );
CPPUNIT_TEST( CharCompareIntl );
CPPUNIT_TEST( StringCompare );
#if wxUSE_UNICODE
CPPUNIT_TEST( StringCompareIntl );
#endif // wxUSE_UNICODE
CPPUNIT_TEST_SUITE_END();
void CharCompare();
@ -199,6 +201,7 @@ void UniCharTestCase::StringCompare()
CPPUNIT_ASSERT( sb[0] != sa);
}
#if wxUSE_UNICODE
void UniCharTestCase::StringCompareIntl()
{
// test string comparison with chars
@ -234,3 +237,4 @@ void UniCharTestCase::StringCompareIntl()
CPPUNIT_ASSERT( sa != sb[0]);
CPPUNIT_ASSERT( sb[0] != sa);
}
#endif // wxUSE_UNICODE

View File

@ -327,6 +327,7 @@ void URITestCase::Unescaping()
CPPUNIT_ASSERT_EQUAL( unescaped, wxURI::Unescape(escaped) );
#if wxUSE_UNICODE
escaped = "http://ru.wikipedia.org/wiki/"
"%D0%A6%D0%B5%D0%BB%D0%BE%D0%B5_%D1%87%D0%B8%D1%81%D0%BB%D0%BE";
@ -338,6 +339,7 @@ void URITestCase::Unescaping()
"\xD1\x87\xD0\xB8\xD1\x81\xD0\xBB\xD0\xBE"
),
unescaped );
#endif // wxUSE_UNICODE
}
void URITestCase::FileScheme()

View File

@ -169,6 +169,7 @@ void XmlTestCase::LoadSave()
CPPUNIT_ASSERT_EQUAL( xmlText, sos.GetString() );
#if wxUSE_UNICODE
const char *utf8xmlText =
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"<word>\n"
@ -191,6 +192,7 @@ void XmlTestCase::LoadSave()
CPPUNIT_ASSERT( doc.Save(sos8) );
CPPUNIT_ASSERT_EQUAL( wxString(utf8xmlText),
wxString(sos8.GetString().ToUTF8()) );
#endif // wxUSE_UNICODE
}
void XmlTestCase::CDATA()