diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-10-20 12:21:24 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-10-20 17:53:18 +0200 |
commit | 82b1bcf7d23d3795347fb45c09ea3c836c246bd3 (patch) | |
tree | 28295d1f5bbb59cd33cf553c714a504897f8f664 /svx | |
parent | 39b1a14b85ec1a0616a08a49f1be16f91a8e7f82 (diff) |
CppunitTest_svx_unit: directly use asserts here
if it failed, it wouldn't be clear why
Change-Id: Ib96674a2d243bea946abff429a267c3ce4fc64f6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104559
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/qa/unit/customshapes.cxx | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/svx/qa/unit/customshapes.cxx b/svx/qa/unit/customshapes.cxx index e42c7ad2fde9..763135208c92 100644 --- a/svx/qa/unit/customshapes.cxx +++ b/svx/qa/unit/customshapes.cxx @@ -514,25 +514,30 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf126060_3D_Z_Rotation) OUString sURL = m_directories.getURLFromSrc(sDataDirectory) + "tdf126060_3D_Z_Rotation.pptx"; mxComponent = loadFromDesktop(sURL, "com.sun.star.comp.drawing.DrawingDocument"); CPPUNIT_ASSERT_MESSAGE("Could not load document", mxComponent.is()); - OUString sErrors; // sErrors collects the errors and should be empty in case all is OK. uno::Reference<drawing::XShape> xShape(getShape(0)); SdrObjCustomShape& rSdrObjCustomShape( static_cast<SdrObjCustomShape&>(*GetSdrObjectFromXShape(xShape))); - if (rSdrObjCustomShape.GetCameraZRotation() != 90) - sErrors += "Wrong text camera Z rotation"; + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong text camera Z rotation", 90.0, + rSdrObjCustomShape.GetCameraZRotation()); basegfx::B2DHomMatrix aObjectTransform; basegfx::B2DPolyPolygon aObjectPolyPolygon; rSdrObjCustomShape.TRGetBaseGeometry(aObjectTransform, aObjectPolyPolygon); - if (aObjectTransform.get(0, 0) != 1492 || aObjectTransform.get(0, 1) != 0 - || aObjectTransform.get(0, 2) != 1129 || aObjectTransform.get(1, 0) != 0 - || aObjectTransform.get(1, 1) != 2500 || aObjectTransform.get(1, 2) != 5846) - sErrors += " Wrong transformation matrix"; - - CPPUNIT_ASSERT_EQUAL(OUString(), sErrors); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong transformation at 0,0 position", 1492.0, + aObjectTransform.get(0, 0)); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong transformation at 0,1 position", 0.0, + aObjectTransform.get(0, 1)); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong transformation at 0,2 position", 1129.0, + aObjectTransform.get(0, 2)); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong transformation at 1,0 position", 0.0, + aObjectTransform.get(1, 0)); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong transformation at 1,1 position", 2500.0, + aObjectTransform.get(1, 1)); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong transformation at 1,2 position", 5846.0, + aObjectTransform.get(1, 2)); } CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf127785_Asymmetric) @@ -621,13 +626,11 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf128413_tbrlOnOff) awt::Rectangle aObservedRect; xShapeProps->getPropertyValue(UNO_NAME_MISC_OBJ_FRAMERECT) >>= aObservedRect; - OUString sError; - if (aOrigRect.Width != aObservedRect.Width || aOrigRect.Height != aObservedRect.Height - || aOrigRect.X != aObservedRect.X || aOrigRect.Y != aObservedRect.Y) - { - sError = "Shape has wrong size or wrong position."; - } - CPPUNIT_ASSERT_EQUAL(OUString(), sError); + + CPPUNIT_ASSERT_EQUAL_MESSAGE("Shape has wrong width", aOrigRect.Width, aObservedRect.Width); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Shape has wrong height", aOrigRect.Height, aObservedRect.Height); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Shape has wrong X position", aOrigRect.X, aObservedRect.X); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Shape has wrong Y position", aOrigRect.Y, aObservedRect.Y); } CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf129532_MatrixFlipV) |