[Libreoffice-commits] core.git: sw/qa
Mike Kaganski (via logerrit)
logerrit at kemper.freedesktop.org
Thu Jul 11 09:06:35 UTC 2019
sw/qa/extras/ooxmlexport/ooxmlexport7.cxx | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)
New commits:
commit bce7a874d121871dab7976cb148bfe2615a6bcb4
Author: Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Thu Jul 11 09:44:43 2019 +0200
Commit: Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Thu Jul 11 11:05:42 2019 +0200
Compare coordinates with tolerance
The test was excluded from macOS in commit
bdad941d7349f330dab2c3d47237bd380d5b7391, because of "hard to
smooth out Retina-related rounding roundtrip error". But this
is also unreliable e.g. on Windows, where it might fail with
"Expected: 3171 Actual: 3170".
Use CPPUNIT_ASSERT_DOUBLES_EQUAL with a tolerance (set to 1 for now),
and restore testing on macOS.
Change-Id: Ie90c89a15e032ff44593433d13af7732eb520cd9
Reviewed-on: https://gerrit.libreoffice.org/75404
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
index a99d2e2c6ad7..e89134d6ab65 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
@@ -1108,16 +1108,18 @@ DECLARE_OOXMLEXPORT_TEST(testFlipAndRotateCustomShape, "flip_and_rotate.odt")
// check rotation angle
assertXPath(pXmlDoc, "//a:xfrm", "rot", "13500000");
// check the first few coordinates of the polygon
-#ifndef MACOSX /* Retina-related rounding roundtrip error
- * hard to smooth out due to the use of string compare
- * instead of number */
- assertXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path/a:lnTo[1]/a:pt", "x", "2351");
- assertXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path/a:lnTo[1]/a:pt", "y", "3171");
- assertXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path/a:lnTo[2]/a:pt", "x", "1695");
- assertXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path/a:lnTo[2]/a:pt", "y", "3171");
- assertXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path/a:lnTo[3]/a:pt", "x", "1695");
- assertXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path/a:lnTo[3]/a:pt", "y", "1701");
-#endif
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(
+ 2351, getXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path/a:lnTo[1]/a:pt", "x").toInt32(), 1);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(
+ 3171, getXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path/a:lnTo[1]/a:pt", "y").toInt32(), 1);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(
+ 1695, getXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path/a:lnTo[2]/a:pt", "x").toInt32(), 1);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(
+ 3171, getXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path/a:lnTo[2]/a:pt", "y").toInt32(), 1);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(
+ 1695, getXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path/a:lnTo[3]/a:pt", "x").toInt32(), 1);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(
+ 1701, getXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path/a:lnTo[3]/a:pt", "y").toInt32(), 1);
}
DECLARE_OOXMLEXPORT_TEST(testTdf92335, "tdf92335.docx")
More information about the Libreoffice-commits
mailing list