[Libreoffice-commits] core.git: chart2/qa

Balazs Varga (via logerrit) logerrit at kemper.freedesktop.org
Thu Dec 12 10:55:41 UTC 2019


 chart2/qa/extras/chart2export.cxx |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

New commits:
commit c0e035647a7178d642f6c19ef279bdd29bd423db
Author:     Balazs Varga <balazs.varga991 at gmail.com>
AuthorDate: Wed Dec 11 21:17:14 2019 +0100
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Thu Dec 12 11:54:22 2019 +0100

    Unit test clean-up for testAxisTitlePositionDOCX
    
    Related commit: 9ff954d5f780cae5df6942e97b713cfc19449145
    (tdf#127908 tdf#128193 Chart OOXML: Fix Custom Y axis title position)
    
    Change-Id: I5b239e8cc5d2e497e7ecd6443b9e2f3001c3c231
    Reviewed-on: https://gerrit.libreoffice.org/84991
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx
index 1645c1c1d1ae..181645b437e3 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -2023,18 +2023,19 @@ void Chart2ExportTest::testAxisTitlePositionDOCX()
     // test X Axis title position
     OUString aXVal = getXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:title/c:layout/c:manualLayout/c:x", "val");
     double nX = aXVal.toDouble();
-    CPPUNIT_ASSERT(nX > 0.698208 && nX < 0.698209);
+    CPPUNIT_ASSERT_DOUBLES_EQUAL(0.698208543867708, nX, 1e-7);
     OUString aYVal = getXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:title/c:layout/c:manualLayout/c:y", "val");
     double nY = aYVal.toDouble();
-    CPPUNIT_ASSERT(nY > 0.805152 && nY < 0.805153);
+    CPPUNIT_ASSERT_DOUBLES_EQUAL(0.805152435594555, nY, 1e-7);
 
     // test Y Axis title position
     aXVal = getXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:title/c:layout/c:manualLayout/c:x", "val");
     nX = aXVal.toDouble();
-    CPPUNIT_ASSERT(nX > 0.025395 && nX < 0.025396);
+    CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0253953671500755, nX, 1e-7);
     aYVal = getXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:title/c:layout/c:manualLayout/c:y", "val");
     nY = aYVal.toDouble();
-    CPPUNIT_ASSERT(nY > 0.384407 && nY < 0.384408);
+    // just test the first two decimal digits because it is not perfect in docx yet.
+    CPPUNIT_ASSERT_DOUBLES_EQUAL(0.384070199122511, nY, 1e-2);
 }
 
 void Chart2ExportTest::testAxisCrossBetweenXSLX()


More information about the Libreoffice-commits mailing list