- CPPUNIT_ASSERT( s1 == _T("abcdefgh") );
- CPPUNIT_ASSERT( s2 == s1 );
- CPPUNIT_ASSERT( s4 == _T("aaaaaaaa") );
- CPPUNIT_ASSERT( s5 == _T("abcdefgh") );
- CPPUNIT_ASSERT( s6 == s1 );
- CPPUNIT_ASSERT( s7 == s1 );
- CPPUNIT_ASSERT( s8 == _T("efgh") );
+ CPPUNIT_ASSERT_EQUAL( wxT("abcdefgh"), s1 );
+ CPPUNIT_ASSERT_EQUAL( s1, s2 );
+ CPPUNIT_ASSERT_EQUAL( wxT("aaaaaaaa"), s4 );
+ CPPUNIT_ASSERT_EQUAL( wxT("abcdefgh"), s5 );
+ CPPUNIT_ASSERT_EQUAL( s1, s6 );
+ CPPUNIT_ASSERT_EQUAL( s1, s7 );
+ CPPUNIT_ASSERT_EQUAL( wxT("efgh"), s8 );
+
+ const char *pc = s1.c_str();
+ CPPUNIT_ASSERT_EQUAL( "bcd", wxString(pc + 1, pc + 4) );
+
+ const wchar_t *pw = s2.c_str();
+ CPPUNIT_ASSERT_EQUAL( "a", wxString(pw, pw + 1) );
+}
+
+void StdStringTestCase::StdIterators()
+{
+ // test compilation of default iterators ctors:
+ wxString::iterator i1;
+ wxString::const_iterator i2;
+ wxString::reverse_iterator i3;
+ 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) );