[Libreoffice-commits] core.git: vcl/qa
Mike Kaganski (via logerrit)
logerrit at kemper.freedesktop.org
Wed Jun 2 06:51:54 UTC 2021
vcl/qa/cppunit/pdfexport/pdfexport.cxx | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
New commits:
commit 559fe86c12065fc697e36cacb7074d46e46c1e3d
Author: Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Tue Jun 1 23:59:19 2021 +0200
Commit: Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Wed Jun 2 08:51:21 2021 +0200
Use CPPUNIT_ASSERT_DOUBLES_EQUAL, which fits the task
Change-Id: Ifbb49ea89ecd9c07b02df6aa2fb3b3f7e98b79af
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116460
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
index a3575e415d4f..6d1746b4a8b4 100644
--- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx
+++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
@@ -871,36 +871,36 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf108963)
= pPdfPageObject->getPathSegment(0);
CPPUNIT_ASSERT_EQUAL(vcl::pdf::PDFSegmentType::Moveto, pSegment->getType());
basegfx::B2DPoint aPoint = pSegment->getPoint();
- CPPUNIT_ASSERT_EQUAL(245395, static_cast<int>(round(aPoint.getX() * 1000)));
- CPPUNIT_ASSERT_EQUAL(244261, static_cast<int>(round(aPoint.getY() * 1000)));
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(245.395, aPoint.getX(), 0.0005);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(244.261, aPoint.getY(), 0.0005);
CPPUNIT_ASSERT(!pSegment->isClosed());
pSegment = pPdfPageObject->getPathSegment(1);
CPPUNIT_ASSERT_EQUAL(vcl::pdf::PDFSegmentType::Lineto, pSegment->getType());
aPoint = pSegment->getPoint();
- CPPUNIT_ASSERT_EQUAL(275102, static_cast<int>(round(aPoint.getX() * 1000)));
- CPPUNIT_ASSERT_EQUAL(267618, static_cast<int>(round(aPoint.getY() * 1000)));
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(275.102, aPoint.getX(), 0.0005);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(267.618, aPoint.getY(), 0.0005);
CPPUNIT_ASSERT(!pSegment->isClosed());
pSegment = pPdfPageObject->getPathSegment(2);
CPPUNIT_ASSERT_EQUAL(vcl::pdf::PDFSegmentType::Lineto, pSegment->getType());
aPoint = pSegment->getPoint();
- CPPUNIT_ASSERT_EQUAL(287518, static_cast<int>(round(aPoint.getX() * 1000)));
- CPPUNIT_ASSERT_EQUAL(251829, static_cast<int>(round(aPoint.getY() * 1000)));
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(287.518, aPoint.getX(), 0.0005);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(251.829, aPoint.getY(), 0.0005);
CPPUNIT_ASSERT(!pSegment->isClosed());
pSegment = pPdfPageObject->getPathSegment(3);
CPPUNIT_ASSERT_EQUAL(vcl::pdf::PDFSegmentType::Lineto, pSegment->getType());
aPoint = pSegment->getPoint();
- CPPUNIT_ASSERT_EQUAL(257839, static_cast<int>(round(aPoint.getX() * 1000)));
- CPPUNIT_ASSERT_EQUAL(228472, static_cast<int>(round(aPoint.getY() * 1000)));
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(257.839, aPoint.getX(), 0.0005);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(228.472, aPoint.getY(), 0.0005);
CPPUNIT_ASSERT(!pSegment->isClosed());
pSegment = pPdfPageObject->getPathSegment(4);
CPPUNIT_ASSERT_EQUAL(vcl::pdf::PDFSegmentType::Lineto, pSegment->getType());
aPoint = pSegment->getPoint();
- CPPUNIT_ASSERT_EQUAL(245395, static_cast<int>(round(aPoint.getX() * 1000)));
- CPPUNIT_ASSERT_EQUAL(244261, static_cast<int>(round(aPoint.getY() * 1000)));
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(245.395, aPoint.getX(), 0.0005);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(244.261, aPoint.getY(), 0.0005);
CPPUNIT_ASSERT(pSegment->isClosed());
}
}
More information about the Libreoffice-commits
mailing list