chart2/qa/extras/xshape/chart2xshape.cxx | 19 +++++++++++++------ chart2/qa/extras/xshape/data/reference/tolerance.xml | 15 +++++++++++++++ 2 files changed, 28 insertions(+), 6 deletions(-)
New commits: commit ccce752f42adbabe04e221452ceb287b12b678e3 Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Fri Dec 10 16:15:06 2021 +0100 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Fri Dec 10 21:05:08 2021 +0100 Allow for presumably more precise results of some layout calculations ...similar to 19559ebbee160d1625d06feec7e6566772dad231 "Allow for a presumably more precise result of BESSELY(80,9)", where at least on macOS ARM64 Clang 14 trunk (defaulting to -ffp-contract=on now) started to produce values that caused CppunitTest_chart2_xshape to fail with > Test name: Chart2XShapeTest::testPieChartLabels1 > double equality assertion failed > - Expected: 3819 > - Actual : 3820 > - Delta : 1e-08 > - Reference: chart2/qa/extras/xshape/data/reference/tdf90839-1.xml > - Node: /XShapes/XShape[2] > - Attr: positionY > > Test name: Chart2XShapeTest::testPieChartLabels2 > double equality assertion failed > - Expected: 3819 > - Actual : 3820 > - Delta : 1e-08 > - Reference: chart2/qa/extras/xshape/data/reference/tdf90839-2.xml > - Node: /XShapes/XShape[2]/XShapes/XShape[3]/XShapes/XShape[1] > - Attr: positionY > > Test name: Chart2XShapeTest::testPieChartLabels3 > double equality assertion failed > - Expected: 3819 > - Actual : 3820 > - Delta : 1e-08 > - Reference: chart2/qa/extras/xshape/data/reference/tdf90839-3.xml > - Node: /XShapes/XShape[2]/XShapes/XShape[3]/XShapes/XShape[1] > - Attr: positionY > > Test name: Chart2XShapeTest::testPieChartLabels4 > double equality assertion failed > - Expected: 3892 > - Actual : 3893 > - Delta : 1e-08 > - Reference: chart2/qa/extras/xshape/data/reference/tdf90839-4.xml > - Node: /XShapes/XShape[2]/XShapes/XShape[3]/XShapes/XShape[1] > - Attr: positionY and > Test name: Chart2XShapeTest::testPieChartLabels1 > double equality assertion failed > - Expected: 9723 > - Actual : 9722 > - Delta : 1e-08 > - Reference: chart2/qa/extras/xshape/data/reference/tdf90839-1.xml > - Node: /XShapes/XShape[2] > - Attr: sizeY > > Test name: Chart2XShapeTest::testPieChartLabels2 > double equality assertion failed > - Expected: 9723 > - Actual : 9722 > - Delta : 1e-08 > - Reference: chart2/qa/extras/xshape/data/reference/tdf90839-2.xml > - Node: /XShapes/XShape[2]/XShapes/XShape[3]/XShapes/XShape[1] > - Attr: sizeY > > Test name: Chart2XShapeTest::testPieChartLabels3 > double equality assertion failed > - Expected: 9723 > - Actual : 9722 > - Delta : 1e-08 > - Reference: chart2/qa/extras/xshape/data/reference/tdf90839-3.xml > - Node: /XShapes/XShape[2]/XShapes/XShape[3]/XShapes/XShape[1] > - Attr: sizeY > > Test name: Chart2XShapeTest::testPieChartLabels4 > double equality assertion failed > - Expected: 9577 > - Actual : 9576 > - Delta : 1e-08 > - Reference: chart2/qa/extras/xshape/data/reference/tdf90839-4.xml > - Node: /XShapes/XShape[2]/XShapes/XShape[3]/XShapes/XShape[1] > - Attr: sizeY and > Test name: Chart2XShapeTest::testPieChartLabels1 > double equality assertion failed > - Expected: 9724 > - Actual : 9723 > - Delta : 1e-08 > - Reference: chart2/qa/extras/xshape/data/reference/tdf90839-1.xml > - Node: /XShapes/XShape[2]/XShapes/XShape[2]/Transformation/Line2 > - Attr: column2 > > Test name: Chart2XShapeTest::testPieChartLabels2 > double equality assertion failed > - Expected: 4861 > - Actual : 4860 > - Delta : 1e-08 > - Reference: chart2/qa/extras/xshape/data/reference/tdf90839-2.xml > - Node: /XShapes/XShape[2]/XShapes/XShape[3]/XShapes/XShape[1]/XShapes/XShape[2]/XShapes/XShape/XShapes/XShape/XShapes/XShape[5]/Transformation/Line2 > - Attr: column2 > > Test name: Chart2XShapeTest::testPieChartLabels3 > double equality assertion failed > - Expected: 4861 > - Actual : 4860 > - Delta : 1e-08 > - Reference: chart2/qa/extras/xshape/data/reference/tdf90839-3.xml > - Node: /XShapes/XShape[2]/XShapes/XShape[3]/XShapes/XShape[1]/XShapes/XShape[2]/XShapes/XShape/XShapes/XShape/XShapes/XShape[5]/Transformation/Line2 > - Attr: column2 > > Test name: Chart2XShapeTest::testPieChartLabels4 > double equality assertion failed > - Expected: 4788 > - Actual : 4787 > - Delta : 1e-08 > - Reference: chart2/qa/extras/xshape/data/reference/tdf90839-4.xml > - Node: /XShapes/XShape[2]/XShapes/XShape[3]/XShapes/XShape[1]/XShapes/XShape[2]/XShapes/XShape/XShapes/XShape/XShapes/XShape[5]/Transformation/Line2 > - Attr: column2 and > Test name: Chart2XShapeTest::testPieChartLabels1 > double equality assertion failed > - Expected: 3819 > - Actual : 3820 > - Delta : 1e-08 > - Reference: chart2/qa/extras/xshape/data/reference/tdf90839-1.xml > - Node: /XShapes/XShape[2]/XShapes/XShape[2]/Transformation/Line2 > - Attr: column3 > > Test name: Chart2XShapeTest::testPieChartLabels2 > double equality assertion failed > - Expected: 3819 > - Actual : 3820 > - Delta : 1e-08 > - Reference: chart2/qa/extras/xshape/data/reference/tdf90839-2.xml > - Node: /XShapes/XShape[2]/XShapes/XShape[3]/XShapes/XShape[1]/XShapes/XShape[2]/XShapes/XShape/XShapes/XShape/XShapes/XShape[5]/Transformation/Line2 > - Attr: column3 > > Test name: Chart2XShapeTest::testPieChartLabels3 > double equality assertion failed > - Expected: 3819 > - Actual : 3820 > - Delta : 1e-08 > - Reference: chart2/qa/extras/xshape/data/reference/tdf90839-3.xml > - Node: /XShapes/XShape[2]/XShapes/XShape[3]/XShapes/XShape[1]/XShapes/XShape[2]/XShapes/XShape/XShapes/XShape/XShapes/XShape[5]/Transformation/Line2 > - Attr: column3 > > Test name: Chart2XShapeTest::testPieChartLabels4 > double equality assertion failed > - Expected: 3892 > - Actual : 3893 > - Delta : 1e-08 > - Reference: chart2/qa/extras/xshape/data/reference/tdf90839-4.xml > - Node: /XShapes/XShape[2]/XShapes/XShape[3]/XShapes/XShape[1]/XShapes/XShape[2]/XShapes/XShape/XShapes/XShape/XShapes/XShape[5]/Transformation/Line2 > - Attr: column3 Change-Id: Iae3b53c2b8149c78f525ed403b7fe2a20f837427 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126641 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/chart2/qa/extras/xshape/chart2xshape.cxx b/chart2/qa/extras/xshape/chart2xshape.cxx index 6a9b11540010..18141a9ede88 100644 --- a/chart2/qa/extras/xshape/chart2xshape.cxx +++ b/chart2/qa/extras/xshape/chart2xshape.cxx @@ -50,14 +50,16 @@ private: namespace { -bool checkDumpAgainstFile(const OUString& rDump, std::u16string_view aFilePath) +bool checkDumpAgainstFile(const OUString& rDump, std::u16string_view aFilePath, + char const* toleranceFile) { OString aOFile = OUStringToOString(aFilePath, RTL_TEXTENCODING_UTF8); CPPUNIT_ASSERT_MESSAGE("dump is empty", !rDump.isEmpty()); OString aDump = OUStringToOString(rDump, RTL_TEXTENCODING_UTF8); - return doXMLDiff(aOFile.getStr(), aDump.getStr(), static_cast<int>(rDump.getLength()), nullptr); + return doXMLDiff(aOFile.getStr(), aDump.getStr(), static_cast<int>(rDump.getLength()), + toleranceFile); } } @@ -78,10 +80,15 @@ xmlDocUniquePtr Chart2XShapeTest::getXShapeDumpXmlDoc() void Chart2XShapeTest::compareAgainstReference(std::u16string_view rReferenceFile) { - checkDumpAgainstFile(getXShapeDumpString(), - OUStringConcatenation(m_directories.getPathFromSrc( - u"/chart2/qa/extras/xshape/data/reference/") - + rReferenceFile)); + checkDumpAgainstFile( + getXShapeDumpString(), + OUStringConcatenation( + m_directories.getPathFromSrc(u"/chart2/qa/extras/xshape/data/reference/") + + rReferenceFile), + OUStringToOString( + m_directories.getPathFromSrc(u"/chart2/qa/extras/xshape/data/reference/tolerance.xml"), + RTL_TEXTENCODING_UTF8) + .getStr()); } void Chart2XShapeTest::testFdo75075() diff --git a/chart2/qa/extras/xshape/data/reference/tolerance.xml b/chart2/qa/extras/xshape/data/reference/tolerance.xml new file mode 100644 index 000000000000..17ec7220fc77 --- /dev/null +++ b/chart2/qa/extras/xshape/data/reference/tolerance.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * +--> +<tolerances> + <tolerance elementName="Line2" attribName="column2" value="1"/> + <tolerance elementName="Line2" attribName="column3" value="1"/> + <tolerance elementName="XShape" attribName="positionY" value="1"/> + <tolerance elementName="XShape" attribName="sizeY" value="1"/> +</tolerances>