diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-06-30 09:12:40 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-06-30 11:35:56 +0100 |
commit | 1a2912eed9980d7ded481bc60a81597b0c699481 (patch) | |
tree | 6528508c2e04c31345ad1a4392638b118b561b40 /sal/qa | |
parent | 4312ed8c4f85575ab125da84ba09f02430ee9a89 (diff) |
add StringBuffers ::remove
Diffstat (limited to 'sal/qa')
-rw-r--r-- | sal/qa/OStringBuffer/rtl_OStringBuffer.cxx | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx b/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx index b01862f1bb86..257a31b93e4a 100644 --- a/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx +++ b/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx @@ -319,6 +319,53 @@ namespace rtl_OStringBuffer CPPUNIT_TEST_SUITE_END(); }; + + class remove : public CppUnit::TestFixture + { + public: + void setUp() + { + } + + void tearDown() + { + } + + void remove_001() + { + ::rtl::OStringBuffer sb( + RTL_CONSTASCII_STRINGPARAM("Red Hat, Inc.")); + + sb.remove(0, 4); + CPPUNIT_ASSERT(sb.toString().equalsL( + RTL_CONSTASCII_STRINGPARAM("Hat, Inc."))); + + sb.remove(3, 9); + CPPUNIT_ASSERT(sb.toString().equalsL( + RTL_CONSTASCII_STRINGPARAM("Hat"))); + + sb.remove(0, 100); + + CPPUNIT_ASSERT(sb.toString().isEmpty()); + + sb.append(RTL_CONSTASCII_STRINGPARAM("Red Hat, Inc.")); + + sb.remove(3, 100); + + CPPUNIT_ASSERT(sb.toString().equalsL( + RTL_CONSTASCII_STRINGPARAM("Red"))); + + sb.remove(0, sb.getLength()); + + CPPUNIT_ASSERT(sb.toString().isEmpty()); + } + + CPPUNIT_TEST_SUITE(remove); + CPPUNIT_TEST(remove_001); + CPPUNIT_TEST_SUITE_END(); + }; + + // ----------------------------------------------------------------------------- class getLength : public CppUnit::TestFixture @@ -16555,6 +16602,7 @@ CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::append_008_float); CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::append_008_Float_Negative); CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::append_009_double); CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::append_009_Double_Negative); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_OStringBuffer::remove); CPPUNIT_PLUGIN_IMPLEMENT(); |