allow creating wxString from char*, assigning to it from char* and comparing with char* values
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44543 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -355,6 +355,26 @@ void StringTestCase::Compare()
|
||||
CPPUNIT_ASSERT( s1 != neq3 );
|
||||
CPPUNIT_ASSERT( s1 != neq4 );
|
||||
|
||||
CPPUNIT_ASSERT( s1 == wxT("AHH") );
|
||||
CPPUNIT_ASSERT( s1 != wxT("no") );
|
||||
CPPUNIT_ASSERT( s1 < wxT("AZ") );
|
||||
CPPUNIT_ASSERT( s1 <= wxT("AZ") );
|
||||
CPPUNIT_ASSERT( s1 <= wxT("AHH") );
|
||||
CPPUNIT_ASSERT( s1 > wxT("AA") );
|
||||
CPPUNIT_ASSERT( s1 >= wxT("AA") );
|
||||
CPPUNIT_ASSERT( s1 >= wxT("AHH") );
|
||||
|
||||
// test comparison with C strings in Unicode build (must work in ANSI as
|
||||
// well, of course):
|
||||
CPPUNIT_ASSERT( s1 == "AHH" );
|
||||
CPPUNIT_ASSERT( s1 != "no" );
|
||||
CPPUNIT_ASSERT( s1 < "AZ" );
|
||||
CPPUNIT_ASSERT( s1 <= "AZ" );
|
||||
CPPUNIT_ASSERT( s1 <= "AHH" );
|
||||
CPPUNIT_ASSERT( s1 > "AA" );
|
||||
CPPUNIT_ASSERT( s1 >= "AA" );
|
||||
CPPUNIT_ASSERT( s1 >= "AHH" );
|
||||
|
||||
// wxString _s1 = wxT("A\0HH");
|
||||
// wxString _eq = wxT("A\0HH");
|
||||
// wxString _neq1 = wxT("H\0AH");
|
||||
|
@@ -141,6 +141,18 @@ void UnicodeTestCase::ConstructorsWithConversion()
|
||||
CPPUNIT_ASSERT ( wxString("\t[pl]open.format.Sformatuj dyskietk<74>=gfloppy %f",
|
||||
wxConvUTF8) == wxT("") ); //should stop at pos 35
|
||||
#endif
|
||||
|
||||
|
||||
// test using Unicode strings together with char* strings (this must work
|
||||
// in ANSI mode as well, of course):
|
||||
wxString s5("ascii");
|
||||
CPPUNIT_ASSERT( s5 == "ascii" );
|
||||
|
||||
s5 += " value";
|
||||
|
||||
CPPUNIT_ASSERT( strcmp(s5.mb_str(), "ascii value") == 0 );
|
||||
CPPUNIT_ASSERT( s5 == "ascii value" );
|
||||
CPPUNIT_ASSERT( s5 != "SomethingElse" );
|
||||
}
|
||||
|
||||
void UnicodeTestCase::ConversionEmpty()
|
||||
|
Reference in New Issue
Block a user