added test for wxString::MakeLower,MakeUpper

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27540 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2004-05-31 22:06:52 +00:00
parent ac3c86ee7d
commit bd7f096d0e

View File

@@ -45,6 +45,7 @@ private:
CPPUNIT_TEST( Tokenizer ); CPPUNIT_TEST( Tokenizer );
CPPUNIT_TEST( Replace ); CPPUNIT_TEST( Replace );
CPPUNIT_TEST( Match ); CPPUNIT_TEST( Match );
CPPUNIT_TEST( CaseChanges );
CPPUNIT_TEST_SUITE_END(); CPPUNIT_TEST_SUITE_END();
void String(); void String();
@@ -57,6 +58,7 @@ private:
void Tokenizer(); void Tokenizer();
void Replace(); void Replace();
void Match(); void Match();
void CaseChanges();
DECLARE_NO_COPY_CLASS(StringTestCase) DECLARE_NO_COPY_CLASS(StringTestCase)
}; };
@@ -271,3 +273,20 @@ void StringTestCase::Match()
#undef TEST_MATCH #undef TEST_MATCH
} }
void StringTestCase::CaseChanges()
{
wxString s1(_T("Hello!"));
wxString s1u(s1);
wxString s1l(s1);
s1u.MakeUpper();
s1l.MakeLower();
wxString s2u, s2l;
s2u.MakeUpper();
s2l.MakeLower();
CPPUNIT_ASSERT( s1u == _T("HELLO!") );
CPPUNIT_ASSERT( s1l == _T("hello!") );
CPPUNIT_ASSERT( s2u == wxEmptyString );
CPPUNIT_ASSERT( s2l == wxEmptyString );
}