summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorBalazs Varga <balazs.varga991@gmail.com>2019-12-11 21:17:14 +0100
committerStephan Bergmann <sbergman@redhat.com>2019-12-12 11:54:22 +0100
commitc0e035647a7178d642f6c19ef279bdd29bd423db (patch)
tree7507108225cc6a3ee2118cc6d2ab6ed7b559e596 /chart2
parente2c34ce3feac29e12ff47957eb8efcb6ad303709 (diff)
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@redhat.com>
Diffstat (limited to 'chart2')
-rw-r--r--chart2/qa/extras/chart2export.cxx9
1 files changed, 5 insertions, 4 deletions
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()