summaryrefslogtreecommitdiff
path: root/sal/qa
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@suse.cz>2012-03-26 18:02:45 +0200
committerLuboš Luňák <l.lunak@suse.cz>2012-03-26 18:57:04 +0200
commit92fec304fb2820b5719080c0889c7432f819af17 (patch)
treebd757983ff161e7bb910795067158efeae126774 /sal/qa
parent0a08973de9e3431edb90633fcefdbaa1af7837fd (diff)
string literal overloads for OUStringBuffer
Diffstat (limited to 'sal/qa')
-rw-r--r--sal/qa/rtl/strings/test_oustring_stringliterals.cxx12
1 files changed, 12 insertions, 0 deletions
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 <cppunit/extensions/HelperMacros.h>
#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);