Unit test clean-up for testAxisTitlePositionDOCX

Related commit: 9ff954d5f7
(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@redhat.com>
This commit is contained in:
Balazs Varga
2019-12-11 21:17:14 +01:00
committed by Stephan Bergmann
parent e2c34ce3fe
commit c0e035647a

View File

@@ -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()