diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2023-11-19 13:22:44 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2023-11-19 15:23:35 +0100 |
commit | 56c89190a2c717d6c24f2826f3b82ffe41b0ab6e (patch) | |
tree | 33929e7c7177de0bea5a6512bb2b70dfecab5847 /vcl/qa/cppunit/GraphicFormatDetectorTest.cxx | |
parent | e4d8f186d07aa1999e16abff3381e37b8764e964 (diff) |
Extended loplugin:ostr: vcl
Change-Id: I2a9d5383d1831d8bf61e5280d66556d71fccae52
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159666
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'vcl/qa/cppunit/GraphicFormatDetectorTest.cxx')
-rw-r--r-- | vcl/qa/cppunit/GraphicFormatDetectorTest.cxx | 45 |
1 files changed, 26 insertions, 19 deletions
diff --git a/vcl/qa/cppunit/GraphicFormatDetectorTest.cxx b/vcl/qa/cppunit/GraphicFormatDetectorTest.cxx index 945cb6d1c613..13c612e46e05 100644 --- a/vcl/qa/cppunit/GraphicFormatDetectorTest.cxx +++ b/vcl/qa/cppunit/GraphicFormatDetectorTest.cxx @@ -410,30 +410,30 @@ void GraphicFormatDetectorTest::testMatchArray() int nCheckSize = aString.size(); // Check beginning of the input string - pMatchPointer = vcl::matchArrayWithString(pCompleteStringPointer, nCheckSize, "<?xml"); + pMatchPointer = vcl::matchArrayWithString(pCompleteStringPointer, nCheckSize, "<?xml"_ostr); CPPUNIT_ASSERT(pMatchPointer != nullptr); CPPUNIT_ASSERT_EQUAL(0, int(pMatchPointer - pCompleteStringPointer)); CPPUNIT_ASSERT_EQUAL(true, o3tl::starts_with(pMatchPointer, "<?xml")); // Check middle of the input string - pMatchPointer = vcl::matchArrayWithString(aString.c_str(), nCheckSize, "version"); + pMatchPointer = vcl::matchArrayWithString(aString.c_str(), nCheckSize, "version"_ostr); CPPUNIT_ASSERT(pMatchPointer != nullptr); CPPUNIT_ASSERT_EQUAL(6, int(pMatchPointer - pCompleteStringPointer)); CPPUNIT_ASSERT_EQUAL(true, o3tl::starts_with(pMatchPointer, "version")); - pMatchPointer = vcl::matchArrayWithString(aString.c_str(), nCheckSize, "<svg"); + pMatchPointer = vcl::matchArrayWithString(aString.c_str(), nCheckSize, "<svg"_ostr); CPPUNIT_ASSERT(pMatchPointer != nullptr); CPPUNIT_ASSERT_EQUAL(38, int(pMatchPointer - pCompleteStringPointer)); CPPUNIT_ASSERT_EQUAL(true, o3tl::starts_with(pMatchPointer, "<svg")); // Check end of the input string - pMatchPointer = vcl::matchArrayWithString(aString.c_str(), nCheckSize, "/svg>"); + pMatchPointer = vcl::matchArrayWithString(aString.c_str(), nCheckSize, "/svg>"_ostr); CPPUNIT_ASSERT(pMatchPointer != nullptr); CPPUNIT_ASSERT_EQUAL(119, int(pMatchPointer - pCompleteStringPointer)); CPPUNIT_ASSERT_EQUAL(true, o3tl::starts_with(pMatchPointer, "/svg>")); // Check that non-existing search string - pMatchPointer = vcl::matchArrayWithString(aString.c_str(), nCheckSize, "none"); + pMatchPointer = vcl::matchArrayWithString(aString.c_str(), nCheckSize, "none"_ostr); CPPUNIT_ASSERT(pMatchPointer == nullptr); } @@ -448,54 +448,61 @@ void GraphicFormatDetectorTest::testCheckArrayForMatchingStrings() bool bResult; // check beginning string - bResult = vcl::checkArrayForMatchingStrings(pCompleteStringPointer, nCheckSize, { "<?xml" }); + bResult + = vcl::checkArrayForMatchingStrings(pCompleteStringPointer, nCheckSize, { "<?xml"_ostr }); CPPUNIT_ASSERT_EQUAL(true, bResult); // check ending string - bResult = vcl::checkArrayForMatchingStrings(pCompleteStringPointer, nCheckSize, { "/svg>" }); + bResult + = vcl::checkArrayForMatchingStrings(pCompleteStringPointer, nCheckSize, { "/svg>"_ostr }); CPPUNIT_ASSERT_EQUAL(true, bResult); // check middle string - bResult = vcl::checkArrayForMatchingStrings(pCompleteStringPointer, nCheckSize, { "version" }); + bResult + = vcl::checkArrayForMatchingStrings(pCompleteStringPointer, nCheckSize, { "version"_ostr }); CPPUNIT_ASSERT_EQUAL(true, bResult); // check beginning and then ending string bResult = vcl::checkArrayForMatchingStrings(pCompleteStringPointer, nCheckSize, - { "<?xml", "/svg>" }); + { "<?xml"_ostr, "/svg>"_ostr }); CPPUNIT_ASSERT_EQUAL(true, bResult); // check ending and then beginning string bResult = vcl::checkArrayForMatchingStrings(pCompleteStringPointer, nCheckSize, - { "/svg>", "<?xml" }); + { "/svg>"_ostr, "<?xml"_ostr }); CPPUNIT_ASSERT_EQUAL(false, bResult); // check middle strings bResult = vcl::checkArrayForMatchingStrings(pCompleteStringPointer, nCheckSize, - { "version", "<svg" }); + { "version"_ostr, "<svg"_ostr }); CPPUNIT_ASSERT_EQUAL(true, bResult); // check beginning, middle and ending strings - bResult = vcl::checkArrayForMatchingStrings(pCompleteStringPointer, nCheckSize, - { "<?xml", "version", "<svg", "/svg>" }); + bResult = vcl::checkArrayForMatchingStrings( + pCompleteStringPointer, nCheckSize, + { "<?xml"_ostr, "version"_ostr, "<svg"_ostr, "/svg>"_ostr }); CPPUNIT_ASSERT_EQUAL(true, bResult); // check non-existing - bResult = vcl::checkArrayForMatchingStrings(pCompleteStringPointer, nCheckSize, { "none" }); + bResult + = vcl::checkArrayForMatchingStrings(pCompleteStringPointer, nCheckSize, { "none"_ostr }); CPPUNIT_ASSERT_EQUAL(false, bResult); // check non-existing on the beginning - bResult = vcl::checkArrayForMatchingStrings(pCompleteStringPointer, nCheckSize, - { "none", "version", "<svg", "/svg>" }); + bResult = vcl::checkArrayForMatchingStrings( + pCompleteStringPointer, nCheckSize, + { "none"_ostr, "version"_ostr, "<svg"_ostr, "/svg>"_ostr }); CPPUNIT_ASSERT_EQUAL(false, bResult); // check non-existing on the end - bResult = vcl::checkArrayForMatchingStrings(pCompleteStringPointer, nCheckSize, - { "<?xml", "version", "<svg", "none" }); + bResult = vcl::checkArrayForMatchingStrings( + pCompleteStringPointer, nCheckSize, + { "<?xml"_ostr, "version"_ostr, "<svg"_ostr, "none"_ostr }); CPPUNIT_ASSERT_EQUAL(false, bResult); // check non-existing after the end bResult = vcl::checkArrayForMatchingStrings(pCompleteStringPointer, nCheckSize, - { "<?xml", "/svg>", "none" }); + { "<?xml"_ostr, "/svg>"_ostr, "none"_ostr }); CPPUNIT_ASSERT_EQUAL(false, bResult); } |