From 92fec304fb2820b5719080c0889c7432f819af17 Mon Sep 17 00:00:00 2001 From: Luboš Luňák Date: Mon, 26 Mar 2012 18:02:45 +0200 Subject: string literal overloads for OUStringBuffer --- sal/qa/rtl/strings/test_oustring_stringliterals.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'sal/qa') diff --git a/sal/qa/rtl/strings/test_oustring_stringliterals.cxx b/sal/qa/rtl/strings/test_oustring_stringliterals.cxx index 59e130071484..9c8c934282eb 100644 --- a/sal/qa/rtl/strings/test_oustring_stringliterals.cxx +++ b/sal/qa/rtl/strings/test_oustring_stringliterals.cxx @@ -37,6 +37,7 @@ extern bool rtl_string_unittest_const_literal; #include #include "rtl/string.h" #include "rtl/ustring.hxx" +#include "rtl/ustrbuf.hxx" #include "rtl/oustringostreaminserter.hxx" namespace test { namespace oustring { @@ -48,6 +49,7 @@ private: void checkUsage(); void checkExtraIntArgument(); void checkNonconstChar(); + void checkBuffer(); void testcall( const char str[] ); // invalid conversions will trigger templated OUString ctor that creates an empty string @@ -59,6 +61,7 @@ CPPUNIT_TEST(checkCtors); CPPUNIT_TEST(checkUsage); CPPUNIT_TEST(checkExtraIntArgument); CPPUNIT_TEST(checkNonconstChar); +CPPUNIT_TEST(checkBuffer); CPPUNIT_TEST_SUITE_END(); }; @@ -160,6 +163,15 @@ void test::oustring::StringLiterals::checkNonconstChar() CPPUNIT_ASSERT( rtl::OUString( "foobar" ) == rtl::OUString( "footest" ).replaceAll( consttest, constbar )); } +void test::oustring::StringLiterals::checkBuffer() +{ + rtl::OUStringBuffer buf; + buf.append( "foo" ); + CPPUNIT_ASSERT( buf.toString() == "foo" ); + buf.append( "bar" ); + CPPUNIT_ASSERT( buf.toString() == "foobar" ); +} + }} // namespace CPPUNIT_TEST_SUITE_REGISTRATION(test::oustring::StringLiterals); -- cgit