diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-08-30 07:43:52 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-08-30 07:43:52 +0200 |
commit | 5536aea8228778e00b9f1ca8199d858cd03780ad (patch) | |
tree | d244654bc3c5aa4e5b3a87df5f004ef61049996c /sal/qa/rtl | |
parent | 20f6a6b159c69771dc0e087f63b6c701908e32e2 (diff) |
Let OUStringLiteral1 take its arg as ctor arg, not template arg
...which makes it more flexible, can now also be used on non-const arguments.
The drawback of the argument no longer being a compile-time constant is remedied
by making the ctor constexpr.
Change-Id: Ia4903a2cc86791fece92eac0cb8406b6659dd19d
Diffstat (limited to 'sal/qa/rtl')
-rw-r--r-- | sal/qa/rtl/strings/test_oustring_stringliterals.cxx | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/sal/qa/rtl/strings/test_oustring_stringliterals.cxx b/sal/qa/rtl/strings/test_oustring_stringliterals.cxx index ec4bbe244862..e257d7d13f9e 100644 --- a/sal/qa/rtl/strings/test_oustring_stringliterals.cxx +++ b/sal/qa/rtl/strings/test_oustring_stringliterals.cxx @@ -217,36 +217,37 @@ void test::oustring::StringLiterals::checkOUStringLiteral() void test::oustring::StringLiterals::checkOUStringLiteral1() { - auto l1 = rtlunittest::OUStringLiteral1<'A'>(); + auto l1 = rtlunittest::OUStringLiteral1('A'); CPPUNIT_ASSERT_EQUAL(sal_Unicode('A'), l1.c); char const c2 = 'A'; - auto l2 = rtlunittest::OUStringLiteral1<c2>(); + auto l2 = rtlunittest::OUStringLiteral1(c2); CPPUNIT_ASSERT_EQUAL(sal_Unicode('A'), l2.c); - // char c3 = 'A'; auto l3 = rtlunittest::OUStringLiteral1<c3>(); + char c3 = 'A'; auto l3 = rtlunittest::OUStringLiteral1(c3); + CPPUNIT_ASSERT_EQUAL(sal_Unicode('A'), l3.c); - auto l4 = rtlunittest::OUStringLiteral1<sal_Unicode('A')>(); + auto l4 = rtlunittest::OUStringLiteral1(sal_Unicode('A')); CPPUNIT_ASSERT_EQUAL(sal_Unicode('A'), l4.c); sal_Unicode const c5 = 0x100; - auto l5 = rtlunittest::OUStringLiteral1<c5>(); + auto l5 = rtlunittest::OUStringLiteral1(c5); CPPUNIT_ASSERT_EQUAL(c5, l5.c); - rtl::OUString s1{rtlunittest::OUStringLiteral1<'A'>()}; + rtl::OUString s1{rtlunittest::OUStringLiteral1('A')}; CPPUNIT_ASSERT_EQUAL(sal_Int32(1), s1.getLength()); CPPUNIT_ASSERT_EQUAL(sal_Unicode('A'), s1[0]); CPPUNIT_ASSERT_EQUAL( - true, rtl::OUString("A") == rtlunittest::OUStringLiteral1<'A'>()); + true, rtl::OUString("A") == rtlunittest::OUStringLiteral1('A')); CPPUNIT_ASSERT_EQUAL( - false, rtl::OUString("AB") == rtlunittest::OUStringLiteral1<'A'>()); + false, rtl::OUString("AB") == rtlunittest::OUStringLiteral1('A')); CPPUNIT_ASSERT_EQUAL( - false, rtl::OUString("A") != rtlunittest::OUStringLiteral1<'A'>()); + false, rtl::OUString("A") != rtlunittest::OUStringLiteral1('A')); CPPUNIT_ASSERT_EQUAL( - true, rtl::OUString("AB") != rtlunittest::OUStringLiteral1<'A'>()); + true, rtl::OUString("AB") != rtlunittest::OUStringLiteral1('A')); - rtl::OUString s2("A" + rtlunittest::OUStringLiteral1<'b'>()); + rtl::OUString s2("A" + rtlunittest::OUStringLiteral1('b')); CPPUNIT_ASSERT_EQUAL(sal_Int32(2), s2.getLength()); CPPUNIT_ASSERT_EQUAL(sal_Unicode('A'), s2[0]); CPPUNIT_ASSERT_EQUAL(sal_Unicode('b'), s2[1]); |