Implement comparisons between wxString::iterator and const_iterator.
Only comparisons between const_iterator and iterator worked before (because of implicit conversion from the latter to the former), implement the ones in the other direction explicitly now. Closes #12594. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65857 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -34,6 +34,7 @@ private:
|
||||
CPPUNIT_TEST_SUITE( StdStringTestCase );
|
||||
CPPUNIT_TEST( StdConstructors );
|
||||
CPPUNIT_TEST( StdIterators );
|
||||
CPPUNIT_TEST( StdIteratorsCmp );
|
||||
CPPUNIT_TEST( StdAppend );
|
||||
CPPUNIT_TEST( StdAssign );
|
||||
CPPUNIT_TEST( StdCompare );
|
||||
@@ -54,6 +55,7 @@ private:
|
||||
|
||||
void StdConstructors();
|
||||
void StdIterators();
|
||||
void StdIteratorsCmp();
|
||||
void StdAppend();
|
||||
void StdAssign();
|
||||
void StdCompare();
|
||||
@@ -119,6 +121,30 @@ void StdStringTestCase::StdIterators()
|
||||
wxString::const_reverse_iterator i4;
|
||||
}
|
||||
|
||||
void StdStringTestCase::StdIteratorsCmp()
|
||||
{
|
||||
wxString s("foobar");
|
||||
wxString::iterator i = s.begin();
|
||||
wxString::const_iterator ci = s.begin();
|
||||
|
||||
CPPUNIT_ASSERT( i == ci );
|
||||
CPPUNIT_ASSERT( i >= ci );
|
||||
CPPUNIT_ASSERT( i <= ci );
|
||||
CPPUNIT_ASSERT( ci == i );
|
||||
CPPUNIT_ASSERT( ci >= i );
|
||||
CPPUNIT_ASSERT( ci <= i );
|
||||
|
||||
ci++;
|
||||
|
||||
CPPUNIT_ASSERT( i != ci );
|
||||
CPPUNIT_ASSERT( i < ci );
|
||||
CPPUNIT_ASSERT( !(i > ci) );
|
||||
|
||||
CPPUNIT_ASSERT( ci != i );
|
||||
CPPUNIT_ASSERT( ci > i );
|
||||
CPPUNIT_ASSERT( !(ci < i) );
|
||||
}
|
||||
|
||||
void StdStringTestCase::StdAppend()
|
||||
{
|
||||
wxString s1, s2, s3, s4, s5, s6, s7, s8;
|
||||
|
Reference in New Issue
Block a user