From: Vadim Zeitlin Date: Wed, 10 Nov 2010 13:53:49 +0000 (+0000) Subject: Disable unit tests which can't work in ANSI build. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/87f528f15b7b0ef31c992d1bc474b6fbcaba95f9 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 --- diff --git a/tests/mbconv/convautotest.cpp b/tests/mbconv/convautotest.cpp index 5c243b062b..1bdfa82482 100644 --- a/tests/mbconv/convautotest.cpp +++ b/tests/mbconv/convautotest.cpp @@ -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 diff --git a/tests/strings/crt.cpp b/tests/strings/crt.cpp index e0623f6ac5..6010ef85cd 100644 --- a/tests/strings/crt.cpp +++ b/tests/strings/crt.cpp @@ -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(smiley)) ); } +#endif // wxUSE_UNICODE void CrtTestCase::Strcmp() { diff --git a/tests/strings/stdstrings.cpp b/tests/strings/stdstrings.cpp index e4d19cc01d..06d5be2814 100644 --- a/tests/strings/stdstrings.cpp +++ b/tests/strings/stdstrings.cpp @@ -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() diff --git a/tests/strings/unichar.cpp b/tests/strings/unichar.cpp index 67c03f8d73..db96f4ba81 100644 --- a/tests/strings/unichar.cpp +++ b/tests/strings/unichar.cpp @@ -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 diff --git a/tests/uris/uris.cpp b/tests/uris/uris.cpp index 5b2f04feab..f0d47ad3f6 100644 --- a/tests/uris/uris.cpp +++ b/tests/uris/uris.cpp @@ -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() diff --git a/tests/xml/xmltest.cpp b/tests/xml/xmltest.cpp index 79ca9ee3c6..7b1d8ebd53 100644 --- a/tests/xml/xmltest.cpp +++ b/tests/xml/xmltest.cpp @@ -169,6 +169,7 @@ void XmlTestCase::LoadSave() CPPUNIT_ASSERT_EQUAL( xmlText, sos.GetString() ); +#if wxUSE_UNICODE const char *utf8xmlText = "\n" "\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()