]>
git.saurik.com Git - wxWidgets.git/blob - tests/strings/unicode.cpp
5e17bd3a74166a977ac982be7fb18cadda48e047
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: tests/strings/unicode.cpp
3 // Purpose: Unicode unit test
4 // Author: Vadim Zeitlin, Wlodzimierz ABX Skiba
7 // Copyright: (c) 2004 Vadim Zeitlin, Wlodzimierz Skiba
8 ///////////////////////////////////////////////////////////////////////////////
10 // ----------------------------------------------------------------------------
12 // ----------------------------------------------------------------------------
23 // ----------------------------------------------------------------------------
25 // ----------------------------------------------------------------------------
27 class UnicodeTestCase
: public CppUnit::TestCase
33 CPPUNIT_TEST_SUITE( UnicodeTestCase
);
34 CPPUNIT_TEST( ToFromAscii
);
35 CPPUNIT_TEST_SUITE_END();
39 DECLARE_NO_COPY_CLASS(UnicodeTestCase
)
42 // register in the unnamed registry so that these tests are run by default
43 CPPUNIT_TEST_SUITE_REGISTRATION( UnicodeTestCase
);
45 // also include in it's own registry so that these tests can be run alone
46 CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( UnicodeTestCase
, "UnicodeTestCase" );
48 UnicodeTestCase::UnicodeTestCase()
52 void UnicodeTestCase::ToFromAscii()
55 #define TEST_TO_FROM_ASCII(txt) \
57 static const char *msg = txt; \
58 wxString s = wxString::FromAscii(msg); \
59 CPPUNIT_ASSERT( strcmp( s.ToAscii() , msg ) == 0 ); \
62 TEST_TO_FROM_ASCII( "Hello, world!" );
63 TEST_TO_FROM_ASCII( "additional \" special \t test \\ component \n :-)" );