diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2023-04-06 07:29:56 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2023-04-06 23:02:16 +0200 |
commit | d856be879e0b94b36c8f87817de74189a8a04121 (patch) | |
tree | d65ec5f4272bcba1647e0a3a326ee6efa8f619f3 /sax/qa | |
parent | a82a294f4681647fa4e11d8b02147d5881d80b0a (diff) |
Use more *string_view
Change-Id: Ic82bbb1b8d6b03066e66f5eb93e9a94b16b1a9f2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150072
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sax/qa')
-rw-r--r-- | sax/qa/cppunit/attributes.cxx | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/sax/qa/cppunit/attributes.cxx b/sax/qa/cppunit/attributes.cxx index 6c71e9aa182a..5b45876e3e96 100644 --- a/sax/qa/cppunit/attributes.cxx +++ b/sax/qa/cppunit/attributes.cxx @@ -35,7 +35,9 @@ void AttributesTest::test() { rtl::Reference<sax_fastparser::FastAttributeList> xAttributeList( new sax_fastparser::FastAttributeList(nullptr) ); xAttributeList->add(1, "1"); - xAttributeList->add(2, OString("2")); + xAttributeList->add(2, OString::Concat("2")); + xAttributeList->add(3, u"3"); + xAttributeList->add(4, OUString::Concat("4")); // We can't test getValueToken() and getOptionalValueToken() // without XFastTokenHandler :-( @@ -44,20 +46,22 @@ void AttributesTest::test() // xAttributeList->getValueToken(2); CPPUNIT_ASSERT( xAttributeList->hasAttribute(1) ); - CPPUNIT_ASSERT( !xAttributeList->hasAttribute(3) ); + CPPUNIT_ASSERT( !xAttributeList->hasAttribute(5) ); CPPUNIT_ASSERT_EQUAL( OUString("2"), xAttributeList->getOptionalValue(2) ); - CPPUNIT_ASSERT_EQUAL( OUString(), xAttributeList->getOptionalValue(3) ); + CPPUNIT_ASSERT_EQUAL( OUString("3"), xAttributeList->getOptionalValue(3) ); + CPPUNIT_ASSERT_EQUAL( OUString("4"), xAttributeList->getOptionalValue(4) ); + CPPUNIT_ASSERT_EQUAL( OUString(), xAttributeList->getOptionalValue(5) ); CPPUNIT_ASSERT_EQUAL( OUString("1"), xAttributeList->getValue(1) ); - CPPUNIT_ASSERT_THROW( xAttributeList->getValue(3), xml::sax::SAXException ); + CPPUNIT_ASSERT_THROW( xAttributeList->getValue(5), xml::sax::SAXException ); xAttributeList->addUnknown("a", "a"); xAttributeList->addUnknown("b", "b", "b"); xAttributeList->addUnknown("c", "c"); CPPUNIT_ASSERT_EQUAL( sal_Int32(3), xAttributeList->getUnknownAttributes().getLength() ); - CPPUNIT_ASSERT_EQUAL( sal_Int32(2), xAttributeList->getFastAttributes().getLength() ); + CPPUNIT_ASSERT_EQUAL( sal_Int32(4), xAttributeList->getFastAttributes().getLength() ); xAttributeList->clear(); CPPUNIT_ASSERT( !xAttributeList->hasAttribute(1) ); |