diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2012-03-06 10:44:52 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2012-03-12 13:35:56 +0100 |
commit | 2f5f802bcf197c5c65aa4453ad2097d5642b80aa (patch) | |
tree | de73d7917814113d7e593f9c42e7a0242465f447 /sal/qa | |
parent | f2d0fcc26be481c2f872056fb3b8402169d124d8 (diff) |
rtl_uString_newFromLiteral() for string literals
Drop the recently introduced rtl_uString_newFromAscii_WithLength()
and replace it with this one. The name fits better and it'll be also
a distinct function that specifically includes embedded \0's
(because that's what OUString supports and if a string literal
explicitly includes it, it makes sense to copy it as such).
Diffstat (limited to 'sal/qa')
-rw-r--r-- | sal/qa/rtl/strings/test_oustring_stringliterals.cxx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sal/qa/rtl/strings/test_oustring_stringliterals.cxx b/sal/qa/rtl/strings/test_oustring_stringliterals.cxx index ce2d22a530e1..1170ff7e2ed8 100644 --- a/sal/qa/rtl/strings/test_oustring_stringliterals.cxx +++ b/sal/qa/rtl/strings/test_oustring_stringliterals.cxx @@ -77,6 +77,13 @@ void test::oustring::StringLiterals::checkCtors() const char bad5[][ 6 ] = { "test", "test2" }; // CPPUNIT_ASSERT( validConversion( rtl::OUString( bad5[ 0 ] ))); CPPUNIT_ASSERT( validConversion( rtl::OUString( bad5[ 1 ] ))); + +// Check that contents are correct and equal to the case when RTL_CONSTASCII_USTRINGPARAM is used. +// Also check that embedded \0 is included. + CPPUNIT_ASSERT( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "" )) == rtl::OUString( "" )); + CPPUNIT_ASSERT( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "\0" )) == rtl::OUString( "\0" )); + CPPUNIT_ASSERT( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ab" )) == rtl::OUString( "ab" )); + CPPUNIT_ASSERT( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "a\0b" )) == rtl::OUString( "a\0b" )); } void test::oustring::StringLiterals::testcall( const char str[] ) |