CPPUNIT_TEST( CharCompare );
CPPUNIT_TEST( CharCompareIntl );
CPPUNIT_TEST( StringCompare );
+#if wxUSE_UNICODE
CPPUNIT_TEST( StringCompareIntl );
+#endif // wxUSE_UNICODE
CPPUNIT_TEST_SUITE_END();
void CharCompare();
// register in the unnamed registry so that these tests are run by default
CPPUNIT_TEST_SUITE_REGISTRATION( UniCharTestCase );
-// also include in it's own registry so that these tests can be run alone
+// also include in its own registry so that these tests can be run alone
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( UniCharTestCase, "UniCharTestCase" );
void UniCharTestCase::CharCompare()
CPPUNIT_ASSERT( a == a );
CPPUNIT_ASSERT( a == 'a' );
- CPPUNIT_ASSERT( a == _T('a') );
+ CPPUNIT_ASSERT( a == wxT('a') );
CPPUNIT_ASSERT( a == wxUniChar('a') );
- CPPUNIT_ASSERT( a == wxUniChar(_T('a')) );
+ CPPUNIT_ASSERT( a == wxUniChar(wxT('a')) );
+
+ CPPUNIT_ASSERT( a == a );
+ CPPUNIT_ASSERT( 'a' == a );
+ CPPUNIT_ASSERT( wxT('a') == a );
+ CPPUNIT_ASSERT( wxUniChar('a') == a );
+ CPPUNIT_ASSERT( wxUniChar(wxT('a')) == a );
CPPUNIT_ASSERT( a != b );
CPPUNIT_ASSERT( a != 'b' );
- CPPUNIT_ASSERT( a != _T('b') );
+ CPPUNIT_ASSERT( a != wxT('b') );
CPPUNIT_ASSERT( a != wxUniChar('b') );
- CPPUNIT_ASSERT( a != wxUniChar(_T('b')) );
+ CPPUNIT_ASSERT( a != wxUniChar(wxT('b')) );
+
+ CPPUNIT_ASSERT( b != a );
+ CPPUNIT_ASSERT( 'b' != a );
+ CPPUNIT_ASSERT( wxT('b') != a );
+ CPPUNIT_ASSERT( wxUniChar('b') != a );
+ CPPUNIT_ASSERT( wxUniChar(wxT('b')) != a );
CPPUNIT_ASSERT( a < b );
CPPUNIT_ASSERT( a < 'b' );
- CPPUNIT_ASSERT( a < _T('b') );
+ CPPUNIT_ASSERT( a < wxT('b') );
CPPUNIT_ASSERT( a < wxUniChar('b') );
- CPPUNIT_ASSERT( a < wxUniChar(_T('b')) );
+ CPPUNIT_ASSERT( a < wxUniChar(wxT('b')) );
+
+ CPPUNIT_ASSERT( b > a );
+ CPPUNIT_ASSERT( 'b' > a );
+ CPPUNIT_ASSERT( wxT('b') > a );
+ CPPUNIT_ASSERT( wxUniChar('b') > a );
+ CPPUNIT_ASSERT( wxUniChar(wxT('b')) > a );
CPPUNIT_ASSERT( a <= b );
CPPUNIT_ASSERT( a <= 'b' );
- CPPUNIT_ASSERT( a <= _T('b') );
+ CPPUNIT_ASSERT( a <= wxT('b') );
CPPUNIT_ASSERT( a <= wxUniChar('b') );
- CPPUNIT_ASSERT( a <= wxUniChar(_T('b')) );
+ CPPUNIT_ASSERT( a <= wxUniChar(wxT('b')) );
+
+ CPPUNIT_ASSERT( b >= a );
+ CPPUNIT_ASSERT( 'b' >= a );
+ CPPUNIT_ASSERT( wxT('b') >= a );
+ CPPUNIT_ASSERT( wxUniChar('b') >= a );
+ CPPUNIT_ASSERT( wxUniChar(wxT('b')) >= a );
CPPUNIT_ASSERT( a <= a );
CPPUNIT_ASSERT( a <= 'a' );
- CPPUNIT_ASSERT( a <= _T('a') );
+ CPPUNIT_ASSERT( a <= wxT('a') );
CPPUNIT_ASSERT( a <= wxUniChar('a') );
- CPPUNIT_ASSERT( a <= wxUniChar(_T('a')) );
+ CPPUNIT_ASSERT( a <= wxUniChar(wxT('a')) );
+
+ CPPUNIT_ASSERT( a >= a );
+ CPPUNIT_ASSERT( 'a' >= a );
+ CPPUNIT_ASSERT( wxT('a') >= a );
+ CPPUNIT_ASSERT( wxUniChar('a') >= a );
+ CPPUNIT_ASSERT( wxUniChar(wxT('a')) >= a );
CPPUNIT_ASSERT( b > a );
CPPUNIT_ASSERT( b > 'a' );
- CPPUNIT_ASSERT( b > _T('a') );
+ CPPUNIT_ASSERT( b > wxT('a') );
CPPUNIT_ASSERT( b > wxUniChar('a') );
- CPPUNIT_ASSERT( b > wxUniChar(_T('a')) );
+ CPPUNIT_ASSERT( b > wxUniChar(wxT('a')) );
+
+ CPPUNIT_ASSERT( a < b );
+ CPPUNIT_ASSERT( 'a' < b );
+ CPPUNIT_ASSERT( wxT('a') < b );
+ CPPUNIT_ASSERT( wxUniChar('a') < b );
+ CPPUNIT_ASSERT( wxUniChar(wxT('a')) < b );
CPPUNIT_ASSERT( b >= a );
CPPUNIT_ASSERT( b >= 'a' );
- CPPUNIT_ASSERT( b >= _T('a') );
+ CPPUNIT_ASSERT( b >= wxT('a') );
CPPUNIT_ASSERT( b >= wxUniChar('a') );
- CPPUNIT_ASSERT( b >= wxUniChar(_T('a')) );
+ CPPUNIT_ASSERT( b >= wxUniChar(wxT('a')) );
+
+ CPPUNIT_ASSERT( a <= b );
+ CPPUNIT_ASSERT( 'a' <= b );
+ CPPUNIT_ASSERT( wxT('a') <= b );
+ CPPUNIT_ASSERT( wxUniChar('a') <= b );
+ CPPUNIT_ASSERT( wxUniChar(wxT('a')) <= b );
CPPUNIT_ASSERT( b >= b );
CPPUNIT_ASSERT( b >= 'b' );
- CPPUNIT_ASSERT( b >= _T('b') );
+ CPPUNIT_ASSERT( b >= wxT('b') );
CPPUNIT_ASSERT( b >= wxUniChar('b') );
- CPPUNIT_ASSERT( b >= wxUniChar(_T('b')) );
+ CPPUNIT_ASSERT( b >= wxUniChar(wxT('b')) );
+
+ CPPUNIT_ASSERT( b <= b );
+ CPPUNIT_ASSERT( 'b' <= b );
+ CPPUNIT_ASSERT( wxT('b') <= b );
+ CPPUNIT_ASSERT( wxUniChar('b') <= b );
+ CPPUNIT_ASSERT( wxUniChar(wxT('b')) <= b );
CPPUNIT_ASSERT( b - a == 1 );
CPPUNIT_ASSERT( a - b == -1 );
wxString sa = "a";
const wxString sb = "b";
char c1 = 'a';
- wchar_t c2 = _T('a');
+ wchar_t c2 = wxT('a');
wxUniChar c3 = 'a';
CPPUNIT_ASSERT( sa == 'a');
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