diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2023-11-19 15:24:11 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2023-11-19 20:37:13 +0100 |
commit | 75d256929387eb8258439808e830b73abcdf2d8b (patch) | |
tree | f13ea21b01adbf3727e8c5c9b14a9e662409d356 /starmath/qa | |
parent | 97516a3153efcc4996512139b8c80f20b9d246b4 (diff) |
Extended loplugin:ostr: starmath
Change-Id: I24ab27d0f92d2d5d10ca2694138d7964ae947b62
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159676
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'starmath/qa')
-rw-r--r-- | starmath/qa/extras/mmlexport-test.cxx | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/starmath/qa/extras/mmlexport-test.cxx b/starmath/qa/extras/mmlexport-test.cxx index 98607dbec3f2..402df43130d5 100644 --- a/starmath/qa/extras/mmlexport-test.cxx +++ b/starmath/qa/extras/mmlexport-test.cxx @@ -62,8 +62,8 @@ void MathMLExportTest::testBlank() save("MathML XML (Math)"); xmlDocUniquePtr pDoc = parseXml(maTempFile); CPPUNIT_ASSERT(pDoc); - assertXPath(pDoc, "/m:math/m:semantics/m:mrow/m:mspace[1]", "width", "0.5em"); - assertXPath(pDoc, "/m:math/m:semantics/m:mrow/m:mspace[2]", "width", "4em"); + assertXPath(pDoc, "/m:math/m:semantics/m:mrow/m:mspace[1]"_ostr, "width"_ostr, "0.5em"); + assertXPath(pDoc, "/m:math/m:semantics/m:mrow/m:mspace[2]"_ostr, "width"_ostr, "4em"); } void MathMLExportTest::testTdf97049() @@ -75,8 +75,8 @@ void MathMLExportTest::testTdf97049() save("MathML XML (Math)"); xmlDocUniquePtr pDoc = parseXml(maTempFile); CPPUNIT_ASSERT(pDoc); - assertXPath(pDoc, "/m:math/m:semantics/m:mrow/m:mo[1]", "stretchy", "true"); - auto aContent = getXPathContent(pDoc, "/m:math/m:semantics/m:mrow/m:mo[1]"); + assertXPath(pDoc, "/m:math/m:semantics/m:mrow/m:mo[1]"_ostr, "stretchy"_ostr, "true"); + auto aContent = getXPathContent(pDoc, "/m:math/m:semantics/m:mrow/m:mo[1]"_ostr); CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aContent.getLength()); CPPUNIT_ASSERT_EQUAL(u'\x222B', aContent[0]); } @@ -89,19 +89,23 @@ void MathMLExportTest::checkMathVariant(SmDocShell& rDocShell, bool bCapital, bo xmlDocUniquePtr pDoc = parseXml(maTempFile); CPPUNIT_ASSERT(pDoc); if (bCapital) - assertXPathNoAttribute(pDoc, "/m:math/m:semantics/m:mrow/m:mi[1]", "mathvariant"); + assertXPathNoAttribute(pDoc, "/m:math/m:semantics/m:mrow/m:mi[1]"_ostr, "mathvariant"_ostr); else - assertXPath(pDoc, "/m:math/m:semantics/m:mrow/m:mi[1]", "mathvariant", "normal"); - assertXPathNoAttribute(pDoc, "/m:math/m:semantics/m:mrow/m:mstyle[1]/m:mi[1]", "mathvariant"); - assertXPathNoAttribute(pDoc, "/m:math/m:semantics/m:mrow/m:mi[2]", "mathvariant"); - assertXPath(pDoc, "/m:math/m:semantics/m:mrow/m:mstyle[2]/m:mi[1]", "mathvariant", "normal"); + assertXPath(pDoc, "/m:math/m:semantics/m:mrow/m:mi[1]"_ostr, "mathvariant"_ostr, "normal"); + assertXPathNoAttribute(pDoc, "/m:math/m:semantics/m:mrow/m:mstyle[1]/m:mi[1]"_ostr, + "mathvariant"_ostr); + assertXPathNoAttribute(pDoc, "/m:math/m:semantics/m:mrow/m:mi[2]"_ostr, "mathvariant"_ostr); + assertXPath(pDoc, "/m:math/m:semantics/m:mrow/m:mstyle[2]/m:mi[1]"_ostr, "mathvariant"_ostr, + "normal"); if (bSmall) - assertXPathNoAttribute(pDoc, "/m:math/m:semantics/m:mrow/m:mi[3]", "mathvariant"); + assertXPathNoAttribute(pDoc, "/m:math/m:semantics/m:mrow/m:mi[3]"_ostr, "mathvariant"_ostr); else - assertXPath(pDoc, "/m:math/m:semantics/m:mrow/m:mi[3]", "mathvariant", "normal"); - assertXPathNoAttribute(pDoc, "/m:math/m:semantics/m:mrow/m:mstyle[3]/m:mi[1]", "mathvariant"); - assertXPathNoAttribute(pDoc, "/m:math/m:semantics/m:mrow/m:mi[4]", "mathvariant"); - assertXPath(pDoc, "/m:math/m:semantics/m:mrow/m:mstyle[4]/m:mi[1]", "mathvariant", "normal"); + assertXPath(pDoc, "/m:math/m:semantics/m:mrow/m:mi[3]"_ostr, "mathvariant"_ostr, "normal"); + assertXPathNoAttribute(pDoc, "/m:math/m:semantics/m:mrow/m:mstyle[3]/m:mi[1]"_ostr, + "mathvariant"_ostr); + assertXPathNoAttribute(pDoc, "/m:math/m:semantics/m:mrow/m:mi[4]"_ostr, "mathvariant"_ostr); + assertXPath(pDoc, "/m:math/m:semantics/m:mrow/m:mstyle[4]/m:mi[1]"_ostr, "mathvariant"_ostr, + "normal"); rDocShell.SetText(""); } @@ -130,8 +134,10 @@ void MathMLExportTest::testMaj() save("MathML XML (Math)"); xmlDocUniquePtr pDoc = parseXml(maTempFile); CPPUNIT_ASSERT(pDoc); - assertXPath(pDoc, "/m:math/m:semantics/m:mrow/m:munderover/m:mo", "stretchy", "false"); - assertXPathContent(pDoc, "/m:math/m:semantics/m:mrow/m:munderover/m:mo", u"\U0001EEF0"_ustr); + assertXPath(pDoc, "/m:math/m:semantics/m:mrow/m:munderover/m:mo"_ostr, "stretchy"_ostr, + "false"); + assertXPathContent(pDoc, "/m:math/m:semantics/m:mrow/m:munderover/m:mo"_ostr, + u"\U0001EEF0"_ustr); } void MathMLExportTest::testHadd() @@ -143,7 +149,8 @@ void MathMLExportTest::testHadd() save("MathML XML (Math)"); xmlDocUniquePtr pDoc = parseXml(maTempFile); CPPUNIT_ASSERT(pDoc); - assertXPathContent(pDoc, "/m:math/m:semantics/m:mrow/m:munderover/m:mi", u"\U0001EEF1"_ustr); + assertXPathContent(pDoc, "/m:math/m:semantics/m:mrow/m:munderover/m:mi"_ostr, + u"\U0001EEF1"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(MathMLExportTest); |