2.5.3 - cleanups, fixes, etc. etc. -
1. Various stubs for wxCocoa (and the bakefile entries for them) 2. Definitions for some wxCocoa cocoa types in defs.h 3. Hack to attempt to fix SYNC sound for mac carbon 4. Fix for wxCocoa and 10.2 (Dave - I'm already around doing some stuff anyway - I'll go ahead and save you the trouble). 5. 10.2 unicode layer 6. Strings null-char fixes (stems from chartraits patch - essentially the patch minus the chartraits part - HAHA :)) [note to self - swap the 2nd and 3rd params of wxMemchr if you use chartraits and vice versa] * If you have time please run the strings and stdstrings cppunit test suite * Also add more test suites if you want - more is always better :) * This does not include any fixes for mbtowc etc functions as outlined on the ml 7. An attempt to update wxArray docs a little 8. wx/process.h build fix for wxCocoa 9. Unicode fixes in app.mm for wxCocoa 10. Remove newer font panel after Stefan's suggestion git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29693 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -49,6 +49,8 @@ private:
|
||||
CPPUNIT_TEST( Replace );
|
||||
CPPUNIT_TEST( Match );
|
||||
CPPUNIT_TEST( CaseChanges );
|
||||
CPPUNIT_TEST( Compare );
|
||||
CPPUNIT_TEST( CompareNoCase );
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
||||
void String();
|
||||
@@ -65,6 +67,8 @@ private:
|
||||
void Replace();
|
||||
void Match();
|
||||
void CaseChanges();
|
||||
void Compare();
|
||||
void CompareNoCase();
|
||||
|
||||
DECLARE_NO_COPY_CLASS(StringTestCase)
|
||||
};
|
||||
@@ -337,3 +341,85 @@ void StringTestCase::CaseChanges()
|
||||
}
|
||||
#endif // !wxUSE_UNICODE
|
||||
}
|
||||
|
||||
void StringTestCase::Compare()
|
||||
{
|
||||
wxString s1 = wxT("AHH");
|
||||
wxString eq = wxT("AHH");
|
||||
wxString neq1 = wxT("HAH");
|
||||
wxString neq2 = wxT("AH");
|
||||
wxString neq3 = wxT("AHHH");
|
||||
wxString neq4 = wxT("AhH");
|
||||
|
||||
CPPUNIT_ASSERT( s1 == eq );
|
||||
CPPUNIT_ASSERT( s1 != neq1 );
|
||||
CPPUNIT_ASSERT( s1 != neq2 );
|
||||
CPPUNIT_ASSERT( s1 != neq3 );
|
||||
CPPUNIT_ASSERT( s1 != neq4 );
|
||||
|
||||
// wxString _s1 = wxT("A\0HH");
|
||||
// wxString _eq = wxT("A\0HH");
|
||||
// wxString _neq1 = wxT("H\0AH");
|
||||
// wxString _neq2 = wxT("A\0H");
|
||||
// wxString _neq3 = wxT("A\0HHH");
|
||||
// wxString _neq4 = wxT("A\0hH");
|
||||
s1.insert(1,1,'\0');
|
||||
eq.insert(1,1,'\0');
|
||||
neq1.insert(1,1,'\0');
|
||||
neq2.insert(1,1,'\0');
|
||||
neq3.insert(1,1,'\0');
|
||||
neq4.insert(1,1,'\0');
|
||||
|
||||
CPPUNIT_ASSERT( s1 == eq );
|
||||
CPPUNIT_ASSERT( s1 != neq1 );
|
||||
CPPUNIT_ASSERT( s1 != neq2 );
|
||||
CPPUNIT_ASSERT( s1 != neq3 );
|
||||
CPPUNIT_ASSERT( s1 != neq4 );
|
||||
}
|
||||
|
||||
void StringTestCase::CompareNoCase()
|
||||
{
|
||||
wxString s1 = wxT("AHH");
|
||||
wxString eq = wxT("AHH");
|
||||
wxString eq2 = wxT("AhH");
|
||||
wxString eq3 = wxT("ahh");
|
||||
wxString neq = wxT("HAH");
|
||||
wxString neq2 = wxT("AH");
|
||||
wxString neq3 = wxT("AHHH");
|
||||
|
||||
#define CPPUNIT_CNCEQ_ASSERT(s1, s2) CPPUNIT_ASSERT( s1.CmpNoCase(s2) == 0)
|
||||
#define CPPUNIT_CNCNEQ_ASSERT(s1, s2) CPPUNIT_ASSERT( s1.CmpNoCase(s2) != 0)
|
||||
|
||||
CPPUNIT_CNCEQ_ASSERT( s1, eq );
|
||||
CPPUNIT_CNCEQ_ASSERT( s1, eq2 );
|
||||
CPPUNIT_CNCEQ_ASSERT( s1, eq3 );
|
||||
|
||||
CPPUNIT_CNCNEQ_ASSERT( s1, neq );
|
||||
CPPUNIT_CNCNEQ_ASSERT( s1, neq2 );
|
||||
CPPUNIT_CNCNEQ_ASSERT( s1, neq3 );
|
||||
|
||||
|
||||
// wxString _s1 = wxT("A\0HH");
|
||||
// wxString _eq = wxT("A\0HH");
|
||||
// wxString _eq2 = wxT("A\0hH");
|
||||
// wxString _eq3 = wxT("a\0hh");
|
||||
// wxString _neq = wxT("H\0AH");
|
||||
// wxString _neq2 = wxT("A\0H");
|
||||
// wxString _neq3 = wxT("A\0HHH");
|
||||
|
||||
s1.insert(1,1,'\0');
|
||||
eq.insert(1,1,'\0');
|
||||
eq2.insert(1,1,'\0');
|
||||
eq3.insert(1,1,'\0');
|
||||
neq.insert(1,1,'\0');
|
||||
neq2.insert(1,1,'\0');
|
||||
neq3.insert(1,1,'\0');
|
||||
|
||||
CPPUNIT_CNCEQ_ASSERT( s1, eq );
|
||||
CPPUNIT_CNCEQ_ASSERT( s1, eq2 );
|
||||
CPPUNIT_CNCEQ_ASSERT( s1, eq3 );
|
||||
|
||||
CPPUNIT_CNCNEQ_ASSERT( s1, neq );
|
||||
CPPUNIT_CNCNEQ_ASSERT( s1, neq2 );
|
||||
CPPUNIT_CNCNEQ_ASSERT( s1, neq3 );
|
||||
}
|
Reference in New Issue
Block a user