include/test/unoapi_test.hxx   |    2 
 sc/qa/unit/bugfix-test.cxx     |   24 +++++-----
 sc/qa/unit/helper/qahelper.hxx |    2 
 sc/qa/unit/scshapetest.cxx     |   92 ++++++++++++++++++++---------------------
 svx/qa/unit/customshapes.cxx   |   16 +++----
 5 files changed, 68 insertions(+), 68 deletions(-)

New commits:
commit 179f50f810dfa1779de5c1f212f3887031e5567d
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Wed Dec 21 16:43:18 2022 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Wed Dec 21 19:09:46 2022 +0000

    qa: hint about tolerance in names
    
    As suggested by Mike in https://gerrit.libreoffice.org/c/core/+/144171
    
    Change-Id: I653118985b781ebb1eed71587ae19efe45e1c800
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144691
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/include/test/unoapi_test.hxx b/include/test/unoapi_test.hxx
index e008b11ca2f0..e329168dfe7b 100644
--- a/include/test/unoapi_test.hxx
+++ b/include/test/unoapi_test.hxx
@@ -97,7 +97,7 @@ inline void assertRectangleEqual(const tools::Rectangle& 
rExpected, const tools:
                                    rSourceLine, "different Height");
 }
 
-#define CPPUNIT_ASSERT_RECTANGLE_EQUAL(aExpected, aActual, aTolerance)         
                    \
+#define CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aExpected, aActual, 
aTolerance)              \
     assertRectangleEqual(aExpected, aActual, aTolerance, CPPUNIT_SOURCELINE())
 
 #endif // INCLUDED_TEST_UNOAPI_TEST_HXX
diff --git a/sc/qa/unit/bugfix-test.cxx b/sc/qa/unit/bugfix-test.cxx
index 4c7137d39ab2..af5bd91fc27b 100644
--- a/sc/qa/unit/bugfix-test.cxx
+++ b/sc/qa/unit/bugfix-test.cxx
@@ -106,9 +106,9 @@ void ScFiltersTest::testTdf137576_Measureline()
 
     // Check start and end point of measureline
     const Point aStart = pObj->GetPoint(0);
-    CPPUNIT_ASSERT_POINT_EQUAL(Point(4800, 1500), aStart, 1);
+    CPPUNIT_ASSERT_POINT_EQUAL_WITH_TOLERANCE(Point(4800, 1500), aStart, 1);
     const Point aEnd = pObj->GetPoint(1);
-    CPPUNIT_ASSERT_POINT_EQUAL(Point(4800, 5200), aEnd, 1);
+    CPPUNIT_ASSERT_POINT_EQUAL_WITH_TOLERANCE(Point(4800, 5200), aEnd, 1);
 
     // Save and reload
     saveAndReload("calc8");
@@ -124,9 +124,9 @@ void ScFiltersTest::testTdf137576_Measureline()
 
     // Check start and end point of measureline, should be unchanged
     const Point aStart2 = pObj->GetPoint(0);
-    CPPUNIT_ASSERT_POINT_EQUAL(Point(4800, 1500), aStart2, 1);
+    CPPUNIT_ASSERT_POINT_EQUAL_WITH_TOLERANCE(Point(4800, 1500), aStart2, 1);
     const Point aEnd2 = pObj->GetPoint(1);
-    CPPUNIT_ASSERT_POINT_EQUAL(Point(4800, 5200), aEnd2, 1);
+    CPPUNIT_ASSERT_POINT_EQUAL_WITH_TOLERANCE(Point(4800, 5200), aEnd2, 1);
 }
 
 void ScFiltersTest::testTdf137216_HideCol()
@@ -173,9 +173,9 @@ void ScFiltersTest::testTdf137044_CoverHiddenRows()
     // Get original object values
     tools::Rectangle aSnapRectOrig = pObj->GetSnapRect();
     Point aOriginalEndOffset = ScDrawLayer::GetObjData(pObj)->maEndOffset;
-    CPPUNIT_ASSERT_RECTANGLE_EQUAL(tools::Rectangle(Point(500, 3500), 
Size(1501, 11001)),
-                                   aSnapRectOrig, 1);
-    CPPUNIT_ASSERT_POINT_EQUAL(Point(2000, 2499), aOriginalEndOffset, 1);
+    CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(
+        tools::Rectangle(Point(500, 3500), Size(1501, 11001)), aSnapRectOrig, 
1);
+    CPPUNIT_ASSERT_POINT_EQUAL_WITH_TOLERANCE(Point(2000, 2499), 
aOriginalEndOffset, 1);
 
     // Hide rows 5 and 6 in UI = row index 4 to 5.
     pDoc->SetRowHidden(4, 5, 0, true);
@@ -195,9 +195,9 @@ void ScFiltersTest::testTdf137044_CoverHiddenRows()
     // Get new values and compare. End offset should be the same, height 
should be 6000 smaller.
     tools::Rectangle aSnapRectReload = pObj->GetSnapRect();
     Point aReloadEndOffset = ScDrawLayer::GetObjData(pObj)->maEndOffset;
-    CPPUNIT_ASSERT_RECTANGLE_EQUAL(tools::Rectangle(Point(500, 3500), 
Size(1501, 5001)),
-                                   aSnapRectReload, 1);
-    CPPUNIT_ASSERT_POINT_EQUAL(Point(2000, 2499), aReloadEndOffset, 1);
+    CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(
+        tools::Rectangle(Point(500, 3500), Size(1501, 5001)), aSnapRectReload, 
1);
+    CPPUNIT_ASSERT_POINT_EQUAL_WITH_TOLERANCE(Point(2000, 2499), 
aReloadEndOffset, 1);
 }
 
 void ScFiltersTest::testTdf137020_FlipVertical()
@@ -219,7 +219,7 @@ void ScFiltersTest::testTdf137020_FlipVertical()
     // Vertical mirror on center should not change the snap rect.
     pObj->Mirror(aSnapRectOrig.LeftCenter(), aSnapRectOrig.RightCenter());
     const tools::Rectangle aSnapRectFlip = pObj->GetSnapRect();
-    CPPUNIT_ASSERT_RECTANGLE_EQUAL(aSnapRectOrig, aSnapRectFlip, 1);
+    CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aSnapRectOrig, 
aSnapRectFlip, 1);
 
     // Save and reload
     saveAndReload("calc8");
@@ -235,7 +235,7 @@ void ScFiltersTest::testTdf137020_FlipVertical()
 
     // Check pos and size of shape again, should be unchanged
     const tools::Rectangle aSnapRectReload = pObj->GetSnapRect();
-    CPPUNIT_ASSERT_RECTANGLE_EQUAL(aSnapRectOrig, aSnapRectReload, 1);
+    CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aSnapRectOrig, 
aSnapRectReload, 1);
 }
 
 void ScFiltersTest::testTdf64229()
diff --git a/sc/qa/unit/helper/qahelper.hxx b/sc/qa/unit/helper/qahelper.hxx
index d1036ee1299b..128bcad258ad 100644
--- a/sc/qa/unit/helper/qahelper.hxx
+++ b/sc/qa/unit/helper/qahelper.hxx
@@ -197,7 +197,7 @@ inline void assertPointEqual(
     CPPUNIT_NS::assertDoubleEquals( rExpected.Y(), rActual.Y(), nTolerance, 
rSourceLine, "different Y" );
 }
 
-#define CPPUNIT_ASSERT_POINT_EQUAL(aExpected, aActual, aTolerance) \
+#define CPPUNIT_ASSERT_POINT_EQUAL_WITH_TOLERANCE(aExpected, aActual, 
aTolerance) \
         assertPointEqual( aExpected, aActual, aTolerance, CPPUNIT_SOURCELINE() 
)
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/qa/unit/scshapetest.cxx b/sc/qa/unit/scshapetest.cxx
index d7f80607ac96..dc60439a536f 100644
--- a/sc/qa/unit/scshapetest.cxx
+++ b/sc/qa/unit/scshapetest.cxx
@@ -155,7 +155,7 @@ void ScShapeTest::testTdf144242_OpenBezier_noSwapWH()
     pObj = lcl_getSdrObjectWithAssert(*pDoc, 0);
     tools::Rectangle aSnapRect(pObj->GetSnapRect());
     // Without fix in place width and height were swapped
-    CPPUNIT_ASSERT_RECTANGLE_EQUAL(aExpectRect, aSnapRect, 40);
+    CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aExpectRect, aSnapRect, 40);
 }
 
 void ScShapeTest::testTdf144242_Line_noSwapWH()
@@ -188,7 +188,7 @@ void ScShapeTest::testTdf144242_Line_noSwapWH()
     pObj = lcl_getSdrObjectWithAssert(*pDoc, 0);
     tools::Rectangle aSnapRect(pObj->GetSnapRect());
     // Without fix in place width and height were swapped
-    CPPUNIT_ASSERT_RECTANGLE_EQUAL(aExpectRect, aSnapRect, 40);
+    CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aExpectRect, aSnapRect, 40);
 }
 
 void ScShapeTest::testTdf143619_validation_circle_pos()
@@ -214,7 +214,7 @@ void ScShapeTest::testTdf143619_validation_circle_pos()
 
     // Without fix in place the position was (2007, 833)
     Point aPos = pObj->GetSnapRect().TopLeft();
-    CPPUNIT_ASSERT_POINT_EQUAL(Point(6523, 1736), aPos, 1);
+    CPPUNIT_ASSERT_POINT_EQUAL_WITH_TOLERANCE(Point(6523, 1736), aPos, 1);
 }
 
 void ScShapeTest::testTdf140252_DragCreateFormControl()
@@ -379,9 +379,9 @@ void ScShapeTest::testTdf137082_RTL_cell_anchored()
 
     // Test reading was correct
     SdrObject* pObj = lcl_getSdrObjectWithAssert(*pDoc, 0);
-    CPPUNIT_ASSERT_RECTANGLE_EQUAL(aSnapRectA, pObj->GetSnapRect(), 1);
+    CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aSnapRectA, 
pObj->GetSnapRect(), 1);
     pObj = lcl_getSdrObjectWithAssert(*pDoc, 1);
-    CPPUNIT_ASSERT_RECTANGLE_EQUAL(aSnapRectB, pObj->GetSnapRect(), 1);
+    CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aSnapRectB, 
pObj->GetSnapRect(), 1);
 
     // Save and reload.
     saveAndReload("calc8");
@@ -391,9 +391,9 @@ void ScShapeTest::testTdf137082_RTL_cell_anchored()
 
     // And test again
     pObj = lcl_getSdrObjectWithAssert(*pDoc, 0);
-    CPPUNIT_ASSERT_RECTANGLE_EQUAL(aSnapRectA, pObj->GetSnapRect(), 1);
+    CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aSnapRectA, 
pObj->GetSnapRect(), 1);
     pObj = lcl_getSdrObjectWithAssert(*pDoc, 1);
-    CPPUNIT_ASSERT_RECTANGLE_EQUAL(aSnapRectB, pObj->GetSnapRect(), 1);
+    CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aSnapRectB, 
pObj->GetSnapRect(), 1);
 }
 
 void ScShapeTest::testTdf137081_RTL_page_anchored()
@@ -419,18 +419,18 @@ void ScShapeTest::testTdf137081_RTL_page_anchored()
     // Test reading was correct
     SdrObject* pObj = lcl_getSdrObjectWithAssert(*pDoc, 0);
     // Measure line
-    CPPUNIT_ASSERT_POINT_EQUAL(aStart, pObj->GetPoint(0), 1);
-    CPPUNIT_ASSERT_POINT_EQUAL(aEnd, pObj->GetPoint(1), 1);
+    CPPUNIT_ASSERT_POINT_EQUAL_WITH_TOLERANCE(aStart, pObj->GetPoint(0), 1);
+    CPPUNIT_ASSERT_POINT_EQUAL_WITH_TOLERANCE(aEnd, pObj->GetPoint(1), 1);
     // Polyline
     pObj = lcl_getSdrObjectWithAssert(*pDoc, 1);
-    CPPUNIT_ASSERT_POINT_EQUAL(aFirst, pObj->GetPoint(0), 1);
-    CPPUNIT_ASSERT_POINT_EQUAL(aSecond, pObj->GetPoint(1), 1);
-    CPPUNIT_ASSERT_POINT_EQUAL(aThird, pObj->GetPoint(2), 1);
+    CPPUNIT_ASSERT_POINT_EQUAL_WITH_TOLERANCE(aFirst, pObj->GetPoint(0), 1);
+    CPPUNIT_ASSERT_POINT_EQUAL_WITH_TOLERANCE(aSecond, pObj->GetPoint(1), 1);
+    CPPUNIT_ASSERT_POINT_EQUAL_WITH_TOLERANCE(aThird, pObj->GetPoint(2), 1);
     //Custom shape
     SdrObjCustomShape* pObjCS
         = static_cast<SdrObjCustomShape*>(lcl_getSdrObjectWithAssert(*pDoc, 
2));
     CPPUNIT_ASSERT(!pObjCS->IsMirroredX());
-    CPPUNIT_ASSERT_POINT_EQUAL(aTopLeft, pObjCS->GetLogicRect().TopLeft(), 1);
+    CPPUNIT_ASSERT_POINT_EQUAL_WITH_TOLERANCE(aTopLeft, 
pObjCS->GetLogicRect().TopLeft(), 1);
 
     // Save and reload.
     saveAndReload("calc8");
@@ -441,17 +441,17 @@ void ScShapeTest::testTdf137081_RTL_page_anchored()
     // And test again
     pObj = lcl_getSdrObjectWithAssert(*pDoc, 0);
     // Measure line
-    CPPUNIT_ASSERT_POINT_EQUAL(aStart, pObj->GetPoint(0), 1);
-    CPPUNIT_ASSERT_POINT_EQUAL(aEnd, pObj->GetPoint(1), 1);
+    CPPUNIT_ASSERT_POINT_EQUAL_WITH_TOLERANCE(aStart, pObj->GetPoint(0), 1);
+    CPPUNIT_ASSERT_POINT_EQUAL_WITH_TOLERANCE(aEnd, pObj->GetPoint(1), 1);
     // Polyline
     pObj = lcl_getSdrObjectWithAssert(*pDoc, 1);
-    CPPUNIT_ASSERT_POINT_EQUAL(aFirst, pObj->GetPoint(0), 1);
-    CPPUNIT_ASSERT_POINT_EQUAL(aSecond, pObj->GetPoint(1), 1);
-    CPPUNIT_ASSERT_POINT_EQUAL(aThird, pObj->GetPoint(2), 1);
+    CPPUNIT_ASSERT_POINT_EQUAL_WITH_TOLERANCE(aFirst, pObj->GetPoint(0), 1);
+    CPPUNIT_ASSERT_POINT_EQUAL_WITH_TOLERANCE(aSecond, pObj->GetPoint(1), 1);
+    CPPUNIT_ASSERT_POINT_EQUAL_WITH_TOLERANCE(aThird, pObj->GetPoint(2), 1);
     //Custom shape
     pObjCS = static_cast<SdrObjCustomShape*>(lcl_getSdrObjectWithAssert(*pDoc, 
2));
     CPPUNIT_ASSERT(!pObjCS->IsMirroredX());
-    CPPUNIT_ASSERT_POINT_EQUAL(aTopLeft, pObjCS->GetLogicRect().TopLeft(), 1);
+    CPPUNIT_ASSERT_POINT_EQUAL_WITH_TOLERANCE(aTopLeft, 
pObjCS->GetLogicRect().TopLeft(), 1);
 }
 
 void ScShapeTest::testTdf139583_Rotate180deg()
@@ -485,7 +485,7 @@ void ScShapeTest::testTdf139583_Rotate180deg()
     pObj = static_cast<SdrRectObj*>(lcl_getSdrObjectWithAssert(*pDoc, 0));
 
     //  Without the fix in place, the shape would have nearly zero size.
-    CPPUNIT_ASSERT_RECTANGLE_EQUAL(aRect, pObj->GetSnapRect(), 1);
+    CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aRect, pObj->GetSnapRect(), 
1);
 }
 
 void ScShapeTest::testTdf137033_FlipHori_Resize()
@@ -501,7 +501,7 @@ void ScShapeTest::testTdf137033_FlipHori_Resize()
     // Verify shape is correctly loaded. Then set shape to "resize with cell".
     tools::Rectangle aSnapRect(pObj->GetSnapRect());
     const tools::Rectangle aExpectRect(Point(4998, 7000), Size(9644, 6723));
-    CPPUNIT_ASSERT_RECTANGLE_EQUAL(aExpectRect, aSnapRect, 1);
+    CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aExpectRect, aSnapRect, 1);
     ScDrawLayer::SetCellAnchoredFromPosition(*pObj, *pDoc, 0 /*SCTAB*/, true 
/*bResizeWithCell*/);
 
     // Save and reload.
@@ -513,7 +513,7 @@ void ScShapeTest::testTdf137033_FlipHori_Resize()
 
     // Check shape has the original geometry, besides rounding and unit 
conversion errors
     aSnapRect = pObj->GetSnapRect();
-    CPPUNIT_ASSERT_RECTANGLE_EQUAL(aExpectRect, aSnapRect, 1);
+    CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aExpectRect, aSnapRect, 1);
 }
 
 void ScShapeTest::testTdf137033_RotShear_ResizeHide()
@@ -548,7 +548,7 @@ void ScShapeTest::testTdf137033_RotShear_ResizeHide()
                            abs(aShearAngle - aExpectShearAngle) <= 1_deg100);
     CPPUNIT_ASSERT_MESSAGE("Hide rows, rotate angle: ",
                            abs(aRotateAngle - aExpectRotateAngle) <= 1_deg100);
-    CPPUNIT_ASSERT_RECTANGLE_EQUAL(aExpectRect, aSnapRect, 1);
+    CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aExpectRect, aSnapRect, 1);
 
     // Save and reload.
     saveAndReload("calc8");
@@ -565,7 +565,7 @@ void ScShapeTest::testTdf137033_RotShear_ResizeHide()
                            abs(aShearAngle - aExpectShearAngle) <= 3_deg100);
     CPPUNIT_ASSERT_MESSAGE("Reload, rotate angle: ",
                            abs(aRotateAngle - aExpectRotateAngle) <= 3_deg100);
-    CPPUNIT_ASSERT_RECTANGLE_EQUAL(aExpectRect, aSnapRect, 7);
+    CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aExpectRect, aSnapRect, 7);
 }
 
 void ScShapeTest::testTdf137033_RotShear_Hide()
@@ -598,7 +598,7 @@ void ScShapeTest::testTdf137033_RotShear_Hide()
     // Values are manually taken from shape before hiding column C.
     const tools::Rectangle aExpectRect(Point(4500, 3500), Size(15143, 5187));
     const tools::Rectangle aSnapRect = pObj->GetSnapRect();
-    CPPUNIT_ASSERT_RECTANGLE_EQUAL(aExpectRect, aSnapRect, 1);
+    CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aExpectRect, aSnapRect, 1);
 }
 
 void ScShapeTest::testTdf137576_LogicRectInDefaultMeasureline()
@@ -644,7 +644,7 @@ void 
ScShapeTest::testTdf137576_LogicRectInDefaultMeasureline()
 
     // Assert object position is unchanged, besides Twips<->Hmm inaccuracy.
     Point aNewPos = pObj->GetRelativePos();
-    CPPUNIT_ASSERT_POINT_EQUAL(aOldPos, aNewPos, 1);
+    CPPUNIT_ASSERT_POINT_EQUAL_WITH_TOLERANCE(aOldPos, aNewPos, 1);
 }
 
 void ScShapeTest::testTdf137576_LogicRectInNewMeasureline()
@@ -695,8 +695,8 @@ void ScShapeTest::testMeasurelineHideColSave()
     // Make sure loading is correct
     Point aStartPoint(7500, 15000); // according UI
     Point aEndPoint(17500, 8000);
-    CPPUNIT_ASSERT_POINT_EQUAL(aStartPoint, pObj->GetPoint(0), 1);
-    CPPUNIT_ASSERT_POINT_EQUAL(aEndPoint, pObj->GetPoint(1), 1);
+    CPPUNIT_ASSERT_POINT_EQUAL_WITH_TOLERANCE(aStartPoint, pObj->GetPoint(0), 
1);
+    CPPUNIT_ASSERT_POINT_EQUAL_WITH_TOLERANCE(aEndPoint, pObj->GetPoint(1), 1);
 
     // Hide column A
     pDoc->SetColHidden(0, 0, 0, true);
@@ -704,8 +704,8 @@ void ScShapeTest::testMeasurelineHideColSave()
     // Shape should move by column width, here 3000
     aStartPoint.Move(-3000, 0);
     aEndPoint.Move(-3000, 0);
-    CPPUNIT_ASSERT_POINT_EQUAL(aStartPoint, pObj->GetPoint(0), 1);
-    CPPUNIT_ASSERT_POINT_EQUAL(aEndPoint, pObj->GetPoint(1), 1);
+    CPPUNIT_ASSERT_POINT_EQUAL_WITH_TOLERANCE(aStartPoint, pObj->GetPoint(0), 
1);
+    CPPUNIT_ASSERT_POINT_EQUAL_WITH_TOLERANCE(aEndPoint, pObj->GetPoint(1), 1);
 
     // save and reload
     saveAndReload("calc8");
@@ -715,8 +715,8 @@ void ScShapeTest::testMeasurelineHideColSave()
     pObj = lcl_getSdrObjectWithAssert(*pDoc, 0);
 
     // Check that start and end point are unchanged besides rounding and unit 
conversion errors
-    CPPUNIT_ASSERT_POINT_EQUAL(aStartPoint, pObj->GetPoint(0), 2);
-    CPPUNIT_ASSERT_POINT_EQUAL(aEndPoint, pObj->GetPoint(1), 2);
+    CPPUNIT_ASSERT_POINT_EQUAL_WITH_TOLERANCE(aStartPoint, pObj->GetPoint(0), 
2);
+    CPPUNIT_ASSERT_POINT_EQUAL_WITH_TOLERANCE(aEndPoint, pObj->GetPoint(1), 2);
 }
 
 void ScShapeTest::testHideColsShow()
@@ -756,7 +756,7 @@ void ScShapeTest::testHideColsShow()
     // Check object is visible and has old size
     CPPUNIT_ASSERT_MESSAGE("Show: Object should be visible", 
pObj->IsVisible());
     tools::Rectangle aSnapRectShow(pObj->GetSnapRect());
-    CPPUNIT_ASSERT_RECTANGLE_EQUAL(aSnapRectOrig, aSnapRectShow, 1);
+    CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aSnapRectOrig, 
aSnapRectShow, 1);
 }
 
 void ScShapeTest::testTdf138138_MoveCellWithRotatedShape()
@@ -772,7 +772,7 @@ void ScShapeTest::testTdf138138_MoveCellWithRotatedShape()
     // Check anchor and position of shape. The expected values are taken from 
UI.
     tools::Rectangle aSnapRect = pObj->GetSnapRect();
     tools::Rectangle aExpectedRect(Point(10000, 3000), Size(1000, 7500));
-    CPPUNIT_ASSERT_RECTANGLE_EQUAL(aExpectedRect, aSnapRect, 1);
+    CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aExpectedRect, aSnapRect, 1);
 
     // Insert two columns after column B
     uno::Sequence<beans::PropertyValue> aPropertyValues = {
@@ -784,7 +784,7 @@ void ScShapeTest::testTdf138138_MoveCellWithRotatedShape()
     pViewShell->GetViewData().GetDispatcher().Execute(FID_INS_COLUMNS_AFTER);
     aExpectedRect = tools::Rectangle(Point(16000, 3000), Size(1000, 7500)); // 
col width 3000
     aSnapRect = pObj->GetSnapRect();
-    CPPUNIT_ASSERT_RECTANGLE_EQUAL(aExpectedRect, aSnapRect, 1);
+    CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aExpectedRect, aSnapRect, 1);
 
     // Save and reload
     saveAndReload("calc8");
@@ -795,7 +795,7 @@ void ScShapeTest::testTdf138138_MoveCellWithRotatedShape()
 
     // Assert objects size is unchanged, position is shifted.
     aSnapRect = pObj->GetSnapRect();
-    CPPUNIT_ASSERT_RECTANGLE_EQUAL(aExpectedRect, aSnapRect, 1);
+    CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aExpectedRect, aSnapRect, 1);
 }
 
 void ScShapeTest::testLoadVerticalFlip()
@@ -833,10 +833,10 @@ void ScShapeTest::testTdf117948_CollapseBeforeShape()
     // Check anchor and position of shape. The expected values are taken from 
UI before saving.
     tools::Rectangle aSnapRect0Collapse = pObj0->GetSnapRect();
     tools::Rectangle aExpectedRect0(Point(4672, 1334), Size(1787, 1723));
-    CPPUNIT_ASSERT_RECTANGLE_EQUAL(aExpectedRect0, aSnapRect0Collapse, 1);
+    CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aExpectedRect0, 
aSnapRect0Collapse, 1);
     tools::Rectangle aSnapRect1Collapse = pObj1->GetSnapRect();
     tools::Rectangle aExpectedRect1(Point(5647, 4172), Size(21, 3441));
-    CPPUNIT_ASSERT_RECTANGLE_EQUAL(aExpectedRect1, aSnapRect1Collapse, 1);
+    CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aExpectedRect1, 
aSnapRect1Collapse, 1);
 
     // Save and reload
     saveAndReload("calc8");
@@ -849,10 +849,10 @@ void ScShapeTest::testTdf117948_CollapseBeforeShape()
     // Assert objects size and position are not changed. Actual values differ 
a little bit
     // because of cumulated Twips-Hmm conversion errors.
     tools::Rectangle aSnapRect0Reload = pObj0->GetSnapRect();
-    CPPUNIT_ASSERT_RECTANGLE_EQUAL(aExpectedRect0, aSnapRect0Reload, 2);
+    CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aExpectedRect0, 
aSnapRect0Reload, 2);
 
     tools::Rectangle aSnapRect1Reload = pObj1->GetSnapRect();
-    CPPUNIT_ASSERT_RECTANGLE_EQUAL(aExpectedRect1, aSnapRect1Reload, 2);
+    CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aExpectedRect1, 
aSnapRect1Reload, 2);
 }
 
 void ScShapeTest::testTdf137355_UndoHideRows()
@@ -888,7 +888,7 @@ void ScShapeTest::testTdf137355_UndoHideRows()
     CPPUNIT_ASSERT_MESSAGE("Undo: Object should exist", pObj);
     CPPUNIT_ASSERT_MESSAGE("Undo: Object should be visible", 
pObj->IsVisible());
     tools::Rectangle aSnapRectUndo(pObj->GetSnapRect());
-    CPPUNIT_ASSERT_RECTANGLE_EQUAL(aSnapRectOrig, aSnapRectUndo, 1);
+    CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aSnapRectOrig, 
aSnapRectUndo, 1);
 }
 
 void ScShapeTest::testTdf152081_UndoHideColsWithNotes()
@@ -962,7 +962,7 @@ void ScShapeTest::testTdf115655_HideDetail()
 
     // Assert image size is not changed
     tools::Rectangle aSnapRectReload = pObj->GetSnapRect();
-    CPPUNIT_ASSERT_RECTANGLE_EQUAL(aSnapRectOrig, aSnapRectReload, 1);
+    CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aSnapRectOrig, 
aSnapRectReload, 1);
 }
 
 void ScShapeTest::testFitToCellSize()
@@ -991,7 +991,7 @@ void ScShapeTest::testFitToCellSize()
 
     const tools::Rectangle& rShapeRect(pObj->GetSnapRect());
     const tools::Rectangle aCellRect = pDoc->GetMMRect(1, 1, 1, 1, 0);
-    CPPUNIT_ASSERT_RECTANGLE_EQUAL(aCellRect, rShapeRect, 2);
+    CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aCellRect, rShapeRect, 2);
 }
 
 void ScShapeTest::testCustomShapeCellAnchoredRotatedShape()
@@ -1010,7 +1010,7 @@ void 
ScShapeTest::testCustomShapeCellAnchoredRotatedShape()
     pDoc->SetDrawPageSize(0); // trigger recalcpos
     tools::Rectangle aRect(2400, 751, 5772, 3694); // expected snap rect from 
values in file
     const tools::Rectangle& rShapeRect(pObj->GetSnapRect());
-    CPPUNIT_ASSERT_RECTANGLE_EQUAL(aRect, rShapeRect, 1);
+    CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aRect, rShapeRect, 1);
 
     // Check anchor
     ScDrawObjData* pData = ScDrawLayer::GetObjData(pObj);
@@ -1035,7 +1035,7 @@ void ScShapeTest::testLargeAnchorOffset()
 
     const Point aOldPos = pObj->GetRelativePos();
     // Just to check that it imports correctly
-    CPPUNIT_ASSERT_POINT_EQUAL(Point(9504, 9089), aOldPos, 1);
+    CPPUNIT_ASSERT_POINT_EQUAL_WITH_TOLERANCE(Point(9504, 9089), aOldPos, 1);
 
     saveAndReload("calc8");
 
@@ -1048,7 +1048,7 @@ void ScShapeTest::testLargeAnchorOffset()
     //   - Expression: std::abs(rExpected.Y() - rActual.Y()) <= nTolerance
     //   - after reload Y expected 9089 actual 9643 Tolerance 1
     const Point aNewPos = pObj->GetRelativePos();
-    CPPUNIT_ASSERT_POINT_EQUAL(aOldPos, aNewPos, 1);
+    CPPUNIT_ASSERT_POINT_EQUAL_WITH_TOLERANCE(aOldPos, aNewPos, 1);
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(ScShapeTest);
diff --git a/svx/qa/unit/customshapes.cxx b/svx/qa/unit/customshapes.cxx
index 5840d636eb61..38f8159143a0 100644
--- a/svx/qa/unit/customshapes.cxx
+++ b/svx/qa/unit/customshapes.cxx
@@ -327,7 +327,7 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, 
testTdf145245_ExtrusionPosition)
             
static_cast<SdrObjCustomShape&>(*SdrObject::getSdrObjectFromXShape(xShape0)));
         tools::Rectangle aBoundRect(rSdrCustomShape.GetCurrentBoundRect());
         tools::Rectangle aExpected(Point(1000, 1000), Size(6002, 5001));
-        CPPUNIT_ASSERT_RECTANGLE_EQUAL(aExpected, aBoundRect, 40);
+        CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aExpected, aBoundRect, 
40);
     }
     {
         // Second shape has half of extrusion behind the shape.
@@ -337,7 +337,7 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, 
testTdf145245_ExtrusionPosition)
         // Without the fix the height was 1 instead of 5001.
         tools::Rectangle aBoundRect(rSdrCustomShape.GetCurrentBoundRect());
         tools::Rectangle aExpected(Point(9000, 3500), Size(6002, 5001));
-        CPPUNIT_ASSERT_RECTANGLE_EQUAL(aExpected, aBoundRect, 40);
+        CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aExpected, aBoundRect, 
40);
     }
     {
         // Third shape has extrusion before the shape.
@@ -347,7 +347,7 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, 
testTdf145245_ExtrusionPosition)
         // Without the fix the y-coordinate was 1000 instead of 6000.
         tools::Rectangle aBoundRect(rSdrCustomShape.GetCurrentBoundRect());
         tools::Rectangle aExpected(Point(18000, 6000), Size(6002, 5001));
-        CPPUNIT_ASSERT_RECTANGLE_EQUAL(aExpected, aBoundRect, 40);
+        CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aExpected, aBoundRect, 
40);
     }
 }
 
@@ -371,7 +371,7 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, 
testTdf145111_Fontwork_rendering_font_siz
     // The expected values 1501|1777, 3941 x 1446 are only valid for 96dpi.
     tools::Rectangle aBoundRect(rSdrCustomShape.GetCurrentBoundRect());
     tools::Rectangle aExpected(Point(1501, 1777), Size(3941, 1446));
-    CPPUNIT_ASSERT_RECTANGLE_EQUAL(aExpected, aBoundRect, 5);
+    CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aExpected, aBoundRect, 5);
 }
 
 CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf145111_anchor_in_Fontwork)
@@ -478,7 +478,7 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, 
testResizeRotatedShape)
         rSdrShape.NbcResize(rSdrShape.GetRelativePos(), Fraction(1.0), 
Fraction(-0.5));
         tools::Rectangle aSnapRect(rSdrShape.GetSnapRect());
         tools::Rectangle aBoundRect(rSdrShape.GetCurrentBoundRect());
-        CPPUNIT_ASSERT_RECTANGLE_EQUAL(aSnapRect, aBoundRect, 3);
+        CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aSnapRect, aBoundRect, 
3);
     }
 
     // Change height
@@ -488,7 +488,7 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, 
testResizeRotatedShape)
         rSdrShape.NbcResize(rSdrShape.GetRelativePos(), Fraction(1.0), 
Fraction(2.0));
         tools::Rectangle aSnapRect(rSdrShape.GetSnapRect());
         tools::Rectangle aBoundRect(rSdrShape.GetCurrentBoundRect());
-        CPPUNIT_ASSERT_RECTANGLE_EQUAL(aSnapRect, aBoundRect, 3);
+        CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aSnapRect, aBoundRect, 
3);
     }
 
     // Change width
@@ -498,7 +498,7 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, 
testResizeRotatedShape)
         rSdrShape.NbcResize(rSdrShape.GetRelativePos(), Fraction(2.0), 
Fraction(1.0));
         tools::Rectangle aSnapRect(rSdrShape.GetSnapRect());
         tools::Rectangle aBoundRect(rSdrShape.GetCurrentBoundRect());
-        CPPUNIT_ASSERT_RECTANGLE_EQUAL(aSnapRect, aBoundRect, 3);
+        CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aSnapRect, aBoundRect, 
3);
     }
 
     // Change width and mirror horizontal
@@ -508,7 +508,7 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, 
testResizeRotatedShape)
         rSdrShape.NbcResize(rSdrShape.GetRelativePos(), Fraction(-0.5), 
Fraction(1.0));
         tools::Rectangle aSnapRect(rSdrShape.GetSnapRect());
         tools::Rectangle aBoundRect(rSdrShape.GetCurrentBoundRect());
-        CPPUNIT_ASSERT_RECTANGLE_EQUAL(aSnapRect, aBoundRect, 3);
+        CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aSnapRect, aBoundRect, 
3);
     }
 }
 

Reply via email to