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
#pragma hdrstop
#endif
+#if wxUSE_UNICODE
+
#include "wx/convauto.h"
#include "wx/mstream.h"
"\0\0\x03\xB2",
20, line1, line2);
}
+
+#endif // wxUSE_UNICODE
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 );
CPPUNIT_TEST_SUITE_END();
void SetGetEnv();
+#if wxUSE_UNICODE
void Strchr();
+#endif // wxUSE_UNICODE
void Strcmp();
void Strspn();
void Strcspn();
#undef TESTVAR_NAME
}
+#if wxUSE_UNICODE
void CrtTestCase::Strchr()
{
// test that searching for a wide character in a narrow string simply
CPPUNIT_ASSERT( wxStrchr(wxString::FromUTF8(":-) == \xe2\x98\xba"),
static_cast<wchar_t>(smiley)) );
}
+#endif // wxUSE_UNICODE
void CrtTestCase::Strcmp()
{
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()
CPPUNIT_TEST( CharCompare );
CPPUNIT_TEST( CharCompareIntl );
CPPUNIT_TEST( StringCompare );
+#if wxUSE_UNICODE
CPPUNIT_TEST( StringCompareIntl );
+#endif // wxUSE_UNICODE
CPPUNIT_TEST_SUITE_END();
void CharCompare();
CPPUNIT_ASSERT( sb[0] != sa);
}
+#if wxUSE_UNICODE
void UniCharTestCase::StringCompareIntl()
{
// test string comparison with chars
CPPUNIT_ASSERT( sa != sb[0]);
CPPUNIT_ASSERT( sb[0] != sa);
}
+#endif // wxUSE_UNICODE
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";
"\xD1\x87\xD0\xB8\xD1\x81\xD0\xBB\xD0\xBE"
),
unescaped );
+#endif // wxUSE_UNICODE
}
void URITestCase::FileScheme()
CPPUNIT_ASSERT_EQUAL( xmlText, sos.GetString() );
+#if wxUSE_UNICODE
const char *utf8xmlText =
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"<word>\n"
CPPUNIT_ASSERT( doc.Save(sos8) );
CPPUNIT_ASSERT_EQUAL( wxString(utf8xmlText),
wxString(sos8.GetString().ToUTF8()) );
+#endif // wxUSE_UNICODE
}
void XmlTestCase::CDATA()