diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-06-24 15:40:44 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-06-24 15:48:21 +0200 |
commit | 4d4f3512db0cf0bf47c2ba1b39c3813842903ef7 (patch) | |
tree | d684cbc20bcff5071c0de27ec523b81f991e1823 /sal | |
parent | 892455e72a57d890918f37bd2b32d6c5000ba6ff (diff) |
Generalize OUStringLiteral1
...by making all places that accept a string literal via ConstCharArrayDetector
also accept an OUStringLiteral1 via ConstCharArrayDetector (which required some
tweaking of the ConstCharArrayDetector internals). That removes the need for
special-purpose OUStringLiteral1 overloads, and will allow OUStringLiteral1 to
be used in more places.
Change-Id: I370de8480e02f8423cde5677dd38479b81bccdb2
Diffstat (limited to 'sal')
-rw-r--r-- | sal/qa/rtl/strings/test_oustring_stringliterals.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sal/qa/rtl/strings/test_oustring_stringliterals.cxx b/sal/qa/rtl/strings/test_oustring_stringliterals.cxx index 9b85b314c85f..825e7d84ad25 100644 --- a/sal/qa/rtl/strings/test_oustring_stringliterals.cxx +++ b/sal/qa/rtl/strings/test_oustring_stringliterals.cxx @@ -192,6 +192,20 @@ void test::oustring::StringLiterals::checkOUStringLiteral() void test::oustring::StringLiterals::checkOUStringLiteral1() { + auto l1 = rtlunittest::OUStringLiteral1<'A'>(); + CPPUNIT_ASSERT_EQUAL('A', l1.c); + + char const c2 = 'A'; + auto l2 = rtlunittest::OUStringLiteral1<c2>(); + CPPUNIT_ASSERT_EQUAL('A', l2.c); + + // char c3 = 'A'; auto l3 = rtlunittest::OUStringLiteral1<c3>(); + + auto l4 = rtlunittest::OUStringLiteral1<sal_Unicode('A')>(); + CPPUNIT_ASSERT_EQUAL('A', l4.c); + + // auto l5 = rtlunittest::OUStringLiteral1<sal_Unicode(0x100)>(); + rtl::OUString s1; s1 = rtlunittest::OUStringLiteral1<'A'>(); CPPUNIT_ASSERT_EQUAL(sal_Int32(1), s1.getLength()); |