summaryrefslogtreecommitdiff
path: root/sal/qa
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-09-21 22:39:56 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-09-22 15:01:03 +0100
commit08dbc9b657697b74e3dcdeff8a829ba7434b013b (patch)
treeb4b0d9fa217e01066906963565de906e92ed4687 /sal/qa
parent075cd18020cf27250e052e43f08d7b8e99d53718 (diff)
unit test to ensure we can use embedded nulls in OStringBuffer
Diffstat (limited to 'sal/qa')
-rw-r--r--sal/qa/OStringBuffer/rtl_OStringBuffer.cxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx b/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx
index 4bfadc403781..ad2413663181 100644
--- a/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx
+++ b/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx
@@ -2244,6 +2244,25 @@ namespace rtl_OStringBuffer
}
+ void append_null()
+ {
+ ::rtl::OStringBuffer aStrBuf("hello world");
+
+ aStrBuf.append('\0');
+ aStrBuf.append('\0');
+ aStrBuf.append('\0');
+
+ aStrBuf.append("hello world");
+
+ CPPUNIT_ASSERT_MESSAGE
+ (
+ "should be able to append nulls",
+ aStrBuf.getLength() ==
+ 2 * RTL_CONSTASCII_LENGTH("hello world") + 3
+ );
+
+ }
+
#ifdef WITH_CORE
void append_001_021()
{
@@ -2284,6 +2303,7 @@ namespace rtl_OStringBuffer
CPPUNIT_TEST( append_001_018 );
CPPUNIT_TEST( append_001_019 );
CPPUNIT_TEST( append_001_020 );
+ CPPUNIT_TEST( append_null );
#ifdef WITH_CORE
CPPUNIT_TEST( append_001_021 );
#endif