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:
@@ -17,6 +17,8 @@
|
|||||||
#pragma hdrstop
|
#pragma hdrstop
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if wxUSE_UNICODE
|
||||||
|
|
||||||
#include "wx/convauto.h"
|
#include "wx/convauto.h"
|
||||||
|
|
||||||
#include "wx/mstream.h"
|
#include "wx/mstream.h"
|
||||||
@@ -208,3 +210,5 @@ void ConvAutoTestCase::StreamUTF32BE()
|
|||||||
"\0\0\x03\xB2",
|
"\0\0\x03\xB2",
|
||||||
20, line1, line2);
|
20, line1, line2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // wxUSE_UNICODE
|
||||||
|
@@ -44,7 +44,9 @@ public:
|
|||||||
private:
|
private:
|
||||||
CPPUNIT_TEST_SUITE( CrtTestCase );
|
CPPUNIT_TEST_SUITE( CrtTestCase );
|
||||||
CPPUNIT_TEST( SetGetEnv );
|
CPPUNIT_TEST( SetGetEnv );
|
||||||
|
#if wxUSE_UNICODE
|
||||||
CPPUNIT_TEST( Strchr );
|
CPPUNIT_TEST( Strchr );
|
||||||
|
#endif // wxUSE_UNICODE
|
||||||
CPPUNIT_TEST( Strcmp );
|
CPPUNIT_TEST( Strcmp );
|
||||||
CPPUNIT_TEST( Strspn );
|
CPPUNIT_TEST( Strspn );
|
||||||
CPPUNIT_TEST( Strcspn );
|
CPPUNIT_TEST( Strcspn );
|
||||||
@@ -53,7 +55,9 @@ private:
|
|||||||
CPPUNIT_TEST_SUITE_END();
|
CPPUNIT_TEST_SUITE_END();
|
||||||
|
|
||||||
void SetGetEnv();
|
void SetGetEnv();
|
||||||
|
#if wxUSE_UNICODE
|
||||||
void Strchr();
|
void Strchr();
|
||||||
|
#endif // wxUSE_UNICODE
|
||||||
void Strcmp();
|
void Strcmp();
|
||||||
void Strspn();
|
void Strspn();
|
||||||
void Strcspn();
|
void Strcspn();
|
||||||
@@ -91,6 +95,7 @@ void CrtTestCase::SetGetEnv()
|
|||||||
#undef TESTVAR_NAME
|
#undef TESTVAR_NAME
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if wxUSE_UNICODE
|
||||||
void CrtTestCase::Strchr()
|
void CrtTestCase::Strchr()
|
||||||
{
|
{
|
||||||
// test that searching for a wide character in a narrow string simply
|
// 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"),
|
CPPUNIT_ASSERT( wxStrchr(wxString::FromUTF8(":-) == \xe2\x98\xba"),
|
||||||
static_cast<wchar_t>(smiley)) );
|
static_cast<wchar_t>(smiley)) );
|
||||||
}
|
}
|
||||||
|
#endif // wxUSE_UNICODE
|
||||||
|
|
||||||
void CrtTestCase::Strcmp()
|
void CrtTestCase::Strcmp()
|
||||||
{
|
{
|
||||||
|
@@ -515,10 +515,12 @@ void StdStringTestCase::StdResize()
|
|||||||
CPPUNIT_ASSERT_EQUAL( wxT("abcABCdefDEF "), s3 );
|
CPPUNIT_ASSERT_EQUAL( wxT("abcABCdefDEF "), s3 );
|
||||||
CPPUNIT_ASSERT_EQUAL( wxT("abcABCdefDEFWW"), s4 );
|
CPPUNIT_ASSERT_EQUAL( wxT("abcABCdefDEFWW"), s4 );
|
||||||
|
|
||||||
|
#if wxUSE_UNICODE
|
||||||
wxString s =
|
wxString s =
|
||||||
wxString::FromUTF8("\xd0\x9f\xd1\x80\xd0\xb8\xd0\xb2\xd0\xb5\xd1\x82");
|
wxString::FromUTF8("\xd0\x9f\xd1\x80\xd0\xb8\xd0\xb2\xd0\xb5\xd1\x82");
|
||||||
s.resize(3);
|
s.resize(3);
|
||||||
CPPUNIT_ASSERT_EQUAL( wxString::FromUTF8("\xd0\x9f\xd1\x80\xd0\xb8"), s);
|
CPPUNIT_ASSERT_EQUAL( wxString::FromUTF8("\xd0\x9f\xd1\x80\xd0\xb8"), s);
|
||||||
|
#endif // wxUSE_UNICODE
|
||||||
}
|
}
|
||||||
|
|
||||||
void StdStringTestCase::StdRiter()
|
void StdStringTestCase::StdRiter()
|
||||||
|
@@ -38,7 +38,9 @@ private:
|
|||||||
CPPUNIT_TEST( CharCompare );
|
CPPUNIT_TEST( CharCompare );
|
||||||
CPPUNIT_TEST( CharCompareIntl );
|
CPPUNIT_TEST( CharCompareIntl );
|
||||||
CPPUNIT_TEST( StringCompare );
|
CPPUNIT_TEST( StringCompare );
|
||||||
|
#if wxUSE_UNICODE
|
||||||
CPPUNIT_TEST( StringCompareIntl );
|
CPPUNIT_TEST( StringCompareIntl );
|
||||||
|
#endif // wxUSE_UNICODE
|
||||||
CPPUNIT_TEST_SUITE_END();
|
CPPUNIT_TEST_SUITE_END();
|
||||||
|
|
||||||
void CharCompare();
|
void CharCompare();
|
||||||
@@ -199,6 +201,7 @@ void UniCharTestCase::StringCompare()
|
|||||||
CPPUNIT_ASSERT( sb[0] != sa);
|
CPPUNIT_ASSERT( sb[0] != sa);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if wxUSE_UNICODE
|
||||||
void UniCharTestCase::StringCompareIntl()
|
void UniCharTestCase::StringCompareIntl()
|
||||||
{
|
{
|
||||||
// test string comparison with chars
|
// test string comparison with chars
|
||||||
@@ -234,3 +237,4 @@ void UniCharTestCase::StringCompareIntl()
|
|||||||
CPPUNIT_ASSERT( sa != sb[0]);
|
CPPUNIT_ASSERT( sa != sb[0]);
|
||||||
CPPUNIT_ASSERT( sb[0] != sa);
|
CPPUNIT_ASSERT( sb[0] != sa);
|
||||||
}
|
}
|
||||||
|
#endif // wxUSE_UNICODE
|
||||||
|
@@ -327,6 +327,7 @@ void URITestCase::Unescaping()
|
|||||||
CPPUNIT_ASSERT_EQUAL( unescaped, wxURI::Unescape(escaped) );
|
CPPUNIT_ASSERT_EQUAL( unescaped, wxURI::Unescape(escaped) );
|
||||||
|
|
||||||
|
|
||||||
|
#if wxUSE_UNICODE
|
||||||
escaped = "http://ru.wikipedia.org/wiki/"
|
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";
|
"%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"
|
"\xD1\x87\xD0\xB8\xD1\x81\xD0\xBB\xD0\xBE"
|
||||||
),
|
),
|
||||||
unescaped );
|
unescaped );
|
||||||
|
#endif // wxUSE_UNICODE
|
||||||
}
|
}
|
||||||
|
|
||||||
void URITestCase::FileScheme()
|
void URITestCase::FileScheme()
|
||||||
|
@@ -169,6 +169,7 @@ void XmlTestCase::LoadSave()
|
|||||||
CPPUNIT_ASSERT_EQUAL( xmlText, sos.GetString() );
|
CPPUNIT_ASSERT_EQUAL( xmlText, sos.GetString() );
|
||||||
|
|
||||||
|
|
||||||
|
#if wxUSE_UNICODE
|
||||||
const char *utf8xmlText =
|
const char *utf8xmlText =
|
||||||
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
||||||
"<word>\n"
|
"<word>\n"
|
||||||
@@ -191,6 +192,7 @@ void XmlTestCase::LoadSave()
|
|||||||
CPPUNIT_ASSERT( doc.Save(sos8) );
|
CPPUNIT_ASSERT( doc.Save(sos8) );
|
||||||
CPPUNIT_ASSERT_EQUAL( wxString(utf8xmlText),
|
CPPUNIT_ASSERT_EQUAL( wxString(utf8xmlText),
|
||||||
wxString(sos8.GetString().ToUTF8()) );
|
wxString(sos8.GetString().ToUTF8()) );
|
||||||
|
#endif // wxUSE_UNICODE
|
||||||
}
|
}
|
||||||
|
|
||||||
void XmlTestCase::CDATA()
|
void XmlTestCase::CDATA()
|
||||||
|
Reference in New Issue
Block a user