]> git.saurik.com Git - wxWidgets.git/commitdiff
Disable unit tests which can't work in ANSI build.
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 10 Nov 2010 13:53:49 +0000 (13:53 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 10 Nov 2010 13:53:49 +0000 (13:53 +0000)
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

tests/mbconv/convautotest.cpp
tests/strings/crt.cpp
tests/strings/stdstrings.cpp
tests/strings/unichar.cpp
tests/uris/uris.cpp
tests/xml/xmltest.cpp

index 5c243b062bf9c0a905b3850c9a8dd1f23f8691a1..1bdfa82482e69f436a9a1fd5ce00659831ed54d7 100644 (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
index e0623f6ac59a562d327184ce4f0444d38785793e..6010ef85cd1f0002ae71d96241955a3c1f884603 100644 (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()
 {
index e4d19cc01dfb4caf2edbfcad66f04dbb8bf3b544..06d5be281451eae640981a6df08b310118dd0bd8 100644 (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()
index 67c03f8d7397e035cd960c606ed225f662583076..db96f4ba812fc7ceb64c8430e3cc2d5c925d121f 100644 (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
index 5b2f04feab33785fa08c23b6e2f80afaf311172a..f0d47ad3f63d902a6e841872f5a9c5abc54fa956 100644 (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()
index 79ca9ee3c64a29cbfd237a03ba4e0a96f7da9626..7b1d8ebd5363e6a414753e291ab5efb2accfa75b 100644 (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()