diff options
author | dipanshu124 <dipanshu@iitk.ac.in> | 2021-03-02 14:53:31 +0530 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-03-14 20:24:09 +0100 |
commit | 993298cfff01e09142c98faf03c3dbb608369114 (patch) | |
tree | 7ce059f0a2b05f97d13c1192535f61580b6a4894 /sc | |
parent | 75e9b6bcfb515f7b03a357c077b6fa144f7669c3 (diff) |
tdf#139734 Drop redundant asserts after MacrosTest::loadFromDesktop
MacrosTest::loadFromDesktop itself asserts on its return value. Thus,
there additional checks in unit tests are redundant.
Change-Id: Iec9be2293c6337fa747c78a0963e31aa99b60772
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111810
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/qa/extras/anchor.cxx | 8 | ||||
-rw-r--r-- | sc/qa/extras/regression-test.cxx | 2 | ||||
-rw-r--r-- | sc/qa/unit/scshapetest.cxx | 19 |
3 files changed, 0 insertions, 29 deletions
diff --git a/sc/qa/extras/anchor.cxx b/sc/qa/extras/anchor.cxx index 6fb801a6c6f5..347da5ec950f 100644 --- a/sc/qa/extras/anchor.cxx +++ b/sc/qa/extras/anchor.cxx @@ -68,7 +68,6 @@ void ScAnchorTest::testUndoAnchor() createFileURL(u"document_with_linked_graphic.ods", aFileURL); // open the document with graphic included uno::Reference<css::lang::XComponent> xComponent = loadFromDesktop(aFileURL); - CPPUNIT_ASSERT(xComponent.is()); // Get the document model SfxObjectShell* pFoundShell = SfxObjectShell::GetShellFromComponent(xComponent); @@ -200,7 +199,6 @@ void ScAnchorTest::testODFAnchorTypes() createFileURL(u"3AnchorTypes.ods", aFileURL); // open the document with graphic included uno::Reference<css::lang::XComponent> xComponent = loadFromDesktop(aFileURL); - CPPUNIT_ASSERT(xComponent.is()); // Get the document model SfxObjectShell* pFoundShell = SfxObjectShell::GetShellFromComponent(xComponent); @@ -245,7 +243,6 @@ void ScAnchorTest::testCopyColumnWithImages() createFileURL(u"3AnchorTypes.ods", aFileURL); // open the document with graphic included uno::Reference<css::lang::XComponent> xComponent = loadFromDesktop(aFileURL); - CPPUNIT_ASSERT(xComponent.is()); // Get the document model SfxObjectShell* pFoundShell = SfxObjectShell::GetShellFromComponent(xComponent); @@ -317,7 +314,6 @@ void ScAnchorTest::testCutWithImages() createFileURL(u"3AnchorTypes.ods", aFileURL); // open the document with graphic included uno::Reference<css::lang::XComponent> xComponent = loadFromDesktop(aFileURL); - CPPUNIT_ASSERT(xComponent.is()); // Get the document model SfxObjectShell* pFoundShell = SfxObjectShell::GetShellFromComponent(xComponent); @@ -375,7 +371,6 @@ void ScAnchorTest::testTdf121963() OUString aFileURL; createFileURL(u"tdf121963.ods", aFileURL); uno::Reference<css::lang::XComponent> xComponent = loadFromDesktop(aFileURL); - CPPUNIT_ASSERT(xComponent.is()); // Without the accompanying fix in place, this test would have never returned due to an infinite // invalidation loop, where ScGridWindow::Paint() invalidated itself. @@ -389,7 +384,6 @@ void ScAnchorTest::testTdf129552() OUString aFileURL; createFileURL(u"tdf129552.fods", aFileURL); uno::Reference<css::lang::XComponent> xComponent = loadFromDesktop(aFileURL); - CPPUNIT_ASSERT(xComponent.is()); // Without the accompanying fix in place, this test would have never returned due to an infinite // invalidation loop, where ScGridWindow::Paint() invalidated itself. @@ -403,7 +397,6 @@ void ScAnchorTest::testTdf130556() OUString aFileURL; createFileURL(u"tdf130556.ods", aFileURL); uno::Reference<css::lang::XComponent> xComponent = loadFromDesktop(aFileURL); - CPPUNIT_ASSERT(xComponent.is()); // Without the accompanying fix in place, this test would have never returned due to an infinite // invalidation loop, where ScGridWindow::Paint() invalidated itself. @@ -417,7 +410,6 @@ void ScAnchorTest::testTdf134161() OUString aFileURL; createFileURL(u"tdf134161.ods", aFileURL); uno::Reference<css::lang::XComponent> xComponent = loadFromDesktop(aFileURL); - CPPUNIT_ASSERT(xComponent.is()); // Without the accompanying fix in place, this test would have never returned due to an infinite // invalidation loop diff --git a/sc/qa/extras/regression-test.cxx b/sc/qa/extras/regression-test.cxx index 27b85ece8a48..0e26ce2523ba 100644 --- a/sc/qa/extras/regression-test.cxx +++ b/sc/qa/extras/regression-test.cxx @@ -76,8 +76,6 @@ void ScChartRegressionTest::test() createFileURL( "testChart.ods", aFileName); uno::Reference< css::lang::XComponent > xComponent = loadFromDesktop(aFileName, "com.sun.star.sheet.SpreadsheetDocument"); - CPPUNIT_ASSERT(xComponent.is()); - uno::Reference< sheet::XSpreadsheetDocument > xDoc(xComponent, UNO_QUERY_THROW); uno::Reference< container::XIndexAccess > xIA(xDoc->getSheets(), UNO_QUERY_THROW); diff --git a/sc/qa/unit/scshapetest.cxx b/sc/qa/unit/scshapetest.cxx index a6d591c006fd..fad81ddd0e6b 100644 --- a/sc/qa/unit/scshapetest.cxx +++ b/sc/qa/unit/scshapetest.cxx @@ -308,7 +308,6 @@ void ScShapeTest::testTdf140252_LayerOfControl() OUString aFileURL; createFileURL(u"ManualColWidthRowHeight.ods", aFileURL); uno::Reference<css::lang::XComponent> xComponent = loadFromDesktop(aFileURL); - CPPUNIT_ASSERT(xComponent.is()); // Get ScDocShell ScDocShell* pDocSh = lcl_getScDocShellWithAssert(xComponent); @@ -344,7 +343,6 @@ void ScShapeTest::testTdf137082_LTR_to_RTL() OUString aFileURL; createFileURL(u"tdf137082_LTR_arrow_image.ods", aFileURL); uno::Reference<css::lang::XComponent> xComponent = loadFromDesktop(aFileURL); - CPPUNIT_ASSERT(xComponent.is()); // Get document ScDocShell* pDocSh = lcl_getScDocShellWithAssert(xComponent); @@ -379,7 +377,6 @@ void ScShapeTest::testTdf137082_RTL_cell_anchored() OUString aFileURL; createFileURL(u"tdf137082_RTL_cell_anchored.ods", aFileURL); uno::Reference<css::lang::XComponent> xComponent = loadFromDesktop(aFileURL); - CPPUNIT_ASSERT(xComponent.is()); // Get document ScDocShell* pDocSh = lcl_getScDocShellWithAssert(xComponent); @@ -422,7 +419,6 @@ void ScShapeTest::testTdf137081_RTL_page_anchored() OUString aFileURL; createFileURL(u"tdf137081_RTL_page_anchored.ods", aFileURL); uno::Reference<css::lang::XComponent> xComponent = loadFromDesktop(aFileURL); - CPPUNIT_ASSERT(xComponent.is()); // Get document ScDocShell* pDocSh = lcl_getScDocShellWithAssert(xComponent); @@ -489,7 +485,6 @@ void ScShapeTest::testTdf139583_Rotate180deg() OUString aFileURL; createFileURL(u"ManualColWidthRowHeight.ods", aFileURL); uno::Reference<css::lang::XComponent> xComponent = loadFromDesktop(aFileURL); - CPPUNIT_ASSERT(xComponent.is()); // Get document and draw page ScDocShell* pDocSh = lcl_getScDocShellWithAssert(xComponent); @@ -530,7 +525,6 @@ void ScShapeTest::testTdf137033_FlipHori_Resize() OUString aFileURL; createFileURL(u"tdf137033_FlipHoriRotCustomShape.ods", aFileURL); uno::Reference<css::lang::XComponent> xComponent = loadFromDesktop(aFileURL); - CPPUNIT_ASSERT(xComponent.is()); // Get document and shape ScDocShell* pDocSh = lcl_getScDocShellWithAssert(xComponent); @@ -569,7 +563,6 @@ void ScShapeTest::testTdf137033_RotShear_ResizeHide() OUString aFileURL; createFileURL(u"tdf137033_RotShearResizeAnchor.ods", aFileURL); uno::Reference<css::lang::XComponent> xComponent = loadFromDesktop(aFileURL); - CPPUNIT_ASSERT(xComponent.is()); // Get document ScDocShell* pDocSh = lcl_getScDocShellWithAssert(xComponent); @@ -629,7 +622,6 @@ void ScShapeTest::testTdf137033_RotShear_Hide() OUString aFileURL; createFileURL(u"tdf137033_RotShearCellAnchor.ods", aFileURL); uno::Reference<css::lang::XComponent> xComponent = loadFromDesktop(aFileURL); - CPPUNIT_ASSERT(xComponent.is()); // Get document ScDocShell* pDocSh = lcl_getScDocShellWithAssert(xComponent); @@ -674,7 +666,6 @@ void ScShapeTest::testTdf137576_LogicRectInDefaultMeasureline() OUString aFileURL; createFileURL(u"ManualColWidthRowHeight.ods", aFileURL); uno::Reference<css::lang::XComponent> xComponent = loadFromDesktop(aFileURL); - CPPUNIT_ASSERT(xComponent.is()); // Get ScDocShell ScDocShell* pDocSh = lcl_getScDocShellWithAssert(xComponent); @@ -731,7 +722,6 @@ void ScShapeTest::testTdf137576_LogicRectInNewMeasureline() OUString aFileURL; createFileURL(u"ManualColWidthRowHeight.ods", aFileURL); uno::Reference<css::lang::XComponent> xComponent = loadFromDesktop(aFileURL); - CPPUNIT_ASSERT(xComponent.is()); // Get document and draw page ScDocShell* pDocSh = lcl_getScDocShellWithAssert(xComponent); @@ -768,7 +758,6 @@ void ScShapeTest::testMeasurelineHideColSave() OUString aFileURL; createFileURL(u"measurelineHideColSave.ods", aFileURL); uno::Reference<css::lang::XComponent> xComponent = loadFromDesktop(aFileURL); - CPPUNIT_ASSERT(xComponent.is()); // Get document and shape ScDocShell* pDocSh = lcl_getScDocShellWithAssert(xComponent); @@ -815,7 +804,6 @@ void ScShapeTest::testHideColsShow() OUString aFileURL; createFileURL(u"hideColsShow.ods", aFileURL); uno::Reference<css::lang::XComponent> xComponent = loadFromDesktop(aFileURL); - CPPUNIT_ASSERT(xComponent.is()); // Get document and shape ScDocShell* pDocSh = lcl_getScDocShellWithAssert(xComponent); @@ -860,7 +848,6 @@ void ScShapeTest::testTdf138138_MoveCellWithRotatedShape() OUString aFileURL; createFileURL(u"tdf138138_MoveCellWithRotatedShape.ods", aFileURL); uno::Reference<css::lang::XComponent> xComponent = loadFromDesktop(aFileURL); - CPPUNIT_ASSERT(xComponent.is()); // Get document and shape ScDocShell* pDocSh = lcl_getScDocShellWithAssert(xComponent); @@ -909,7 +896,6 @@ void ScShapeTest::testLoadVerticalFlip() OUString aFileURL; createFileURL(u"loadVerticalFlip.ods", aFileURL); uno::Reference<css::lang::XComponent> xComponent = loadFromDesktop(aFileURL); - CPPUNIT_ASSERT(xComponent.is()); // Get document and shape ScDocShell* pDocSh = lcl_getScDocShellWithAssert(xComponent); @@ -930,7 +916,6 @@ void ScShapeTest::testTdf117948_CollapseBeforeShape() OUString aFileURL; createFileURL(u"tdf117948_CollapseBeforeShape.ods", aFileURL); uno::Reference<css::lang::XComponent> xComponent = loadFromDesktop(aFileURL); - CPPUNIT_ASSERT(xComponent.is()); // Get document and objects ScDocShell* pDocSh = lcl_getScDocShellWithAssert(xComponent); @@ -984,7 +969,6 @@ void ScShapeTest::testTdf137355_UndoHideRows() OUString aFileURL; createFileURL(u"tdf137355_UndoHideRows.ods", aFileURL); uno::Reference<css::lang::XComponent> xComponent = loadFromDesktop(aFileURL); - CPPUNIT_ASSERT(xComponent.is()); // Get document and shape ScDocShell* pDocSh = lcl_getScDocShellWithAssert(xComponent); @@ -1028,7 +1012,6 @@ void ScShapeTest::testTdf115655_HideDetail() OUString aFileURL; createFileURL(u"tdf115655_HideDetail.ods", aFileURL); uno::Reference<css::lang::XComponent> xComponent = loadFromDesktop(aFileURL); - CPPUNIT_ASSERT(xComponent.is()); // Get document and image ScDocShell* pDocSh = lcl_getScDocShellWithAssert(xComponent); @@ -1078,7 +1061,6 @@ void ScShapeTest::testFitToCellSize() OUString aFileURL; createFileURL(u"tdf119191_FitToCellSize.ods", aFileURL); uno::Reference<css::lang::XComponent> xComponent = loadFromDesktop(aFileURL); - CPPUNIT_ASSERT(xComponent.is()); // Get document and shape ScDocShell* pDocSh = lcl_getScDocShellWithAssert(xComponent); @@ -1112,7 +1094,6 @@ void ScShapeTest::testCustomShapeCellAnchoredRotatedShape() OUString aFileURL; createFileURL(u"tdf119191_transformedShape.ods", aFileURL); uno::Reference<css::lang::XComponent> xComponent = loadFromDesktop(aFileURL); - CPPUNIT_ASSERT(xComponent.is()); // Get document and shape ScDocShell* pDocSh = lcl_getScDocShellWithAssert(xComponent); |