From ddb4600cd0672a1df8a8ca916c89fd1d2be407af Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Fri, 28 Oct 2016 09:04:39 +0200 Subject: [PATCH] sd: fix loplugin:cppunitassertequals warnings Change-Id: Id2dc5762668b7c3f78f0a0a1ede97d4ac63fab5d --- sd/qa/unit/export-tests-ooxml1.cxx | 6 +++--- sd/qa/unit/export-tests.cxx | 6 +++--- sd/qa/unit/import-tests.cxx | 2 +- sd/qa/unit/tiledrendering/tiledrendering.cxx | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sd/qa/unit/export-tests-ooxml1.cxx b/sd/qa/unit/export-tests-ooxml1.cxx index db2d760065af..8f2ef494ff7c 100644 --- a/sd/qa/unit/export-tests-ooxml1.cxx +++ b/sd/qa/unit/export-tests-ooxml1.cxx @@ -259,16 +259,16 @@ void SdOOXMLExportTest1::testN828390_4() { const SvxFontHeightItem * pFontHeight = dynamic_cast((*it).pAttr); if( pFontHeight ) - CPPUNIT_ASSERT_MESSAGE( "Font height is wrong", pFontHeight->GetHeight() == 1129 ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Font height is wrong", static_cast(1129), pFontHeight->GetHeight() ); const SvxFontItem *pFont = dynamic_cast((*it).pAttr); if( pFont ) { - CPPUNIT_ASSERT_MESSAGE( "Font is wrong", pFont->GetFamilyName() == "Arial"); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Font is wrong", OUString("Arial"), pFont->GetFamilyName() ); bPassed = true; } const SvxWeightItem *pWeight = dynamic_cast((*it).pAttr); if( pWeight ) - CPPUNIT_ASSERT_MESSAGE( "Font Weight is wrong", pWeight->GetWeight() == WEIGHT_BOLD); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Font Weight is wrong", WEIGHT_BOLD, pWeight->GetWeight() ); } } CPPUNIT_ASSERT(bPassed); diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx index 014720e1f7d6..3f2882384031 100644 --- a/sd/qa/unit/export-tests.cxx +++ b/sd/qa/unit/export-tests.cxx @@ -144,7 +144,7 @@ void SdExportTest::testN821567() xDocShRef = saveAndReload( xDocShRef.get(), ODP ); uno::Reference< drawing::XDrawPagesSupplier > xDoc( xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY_THROW ); - CPPUNIT_ASSERT_MESSAGE( "not exactly one page", xDoc->getDrawPages()->getCount() == 1 ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "not exactly one page", static_cast(1), xDoc->getDrawPages()->getCount() ); uno::Reference< drawing::XDrawPage > xPage( getPage( 0, xDocShRef ) ); uno::Reference< beans::XPropertySet > xPropSet( xPage, uno::UNO_QUERY ); @@ -281,7 +281,7 @@ void SdExportTest::testSwappedOutImageExport() // Check whether graphic exported well after it was swapped out uno::Reference xDrawPagesSupplier(xDocShRef->GetModel(), uno::UNO_QUERY); - CPPUNIT_ASSERT_MESSAGE( sFailedMessage.getStr(), xDrawPagesSupplier->getDrawPages()->getCount() == 2 ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( sFailedMessage.getStr(), static_cast(2), xDrawPagesSupplier->getDrawPages()->getCount()); uno::Reference< drawing::XDrawPage > xDrawPage( xDrawPagesSupplier->getDrawPages()->getByIndex(0), uno::UNO_QUERY_THROW ); uno::Reference xImage(xDrawPage->getByIndex(2), uno::UNO_QUERY); @@ -449,7 +449,7 @@ void SdExportTest::testImageWithSpecialID() // Check whether graphic was exported well uno::Reference xDrawPagesSupplier(xDocShRef->GetModel(), uno::UNO_QUERY); - CPPUNIT_ASSERT_MESSAGE( sFailedMessage.getStr(), xDrawPagesSupplier->getDrawPages()->getCount() == 2 ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( sFailedMessage.getStr(), static_cast(2), xDrawPagesSupplier->getDrawPages()->getCount() ); uno::Reference< drawing::XDrawPage > xDrawPage( xDrawPagesSupplier->getDrawPages()->getByIndex(0), uno::UNO_QUERY_THROW ); uno::Reference xImage(xDrawPage->getByIndex(2), uno::UNO_QUERY); diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index c85fda8f5cfe..1d0eef1adf7f 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -1389,7 +1389,7 @@ void SdImportTest::testTdf99729() // If text alignment is wrong, the rectangle will be white. CPPUNIT_ASSERT_MESSAGE("Tdf99729: vertical alignment of text is incorrect!", nonwhitecounts[0]>100); // it is 134 with cleartype disabled // The numbers 1-9 should be below the Text Box -> rectangle 154,16 - 170,112 should be white. - CPPUNIT_ASSERT_MESSAGE("Tdf99729: legacy vertical alignment of text is incorrect!", nonwhitecounts[1] == 0); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Tdf99729: legacy vertical alignment of text is incorrect!", 0, nonwhitecounts[1]); } void SdImportTest::testTdf89927() diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx index 049b9568eab9..f930df8b310b 100644 --- a/sd/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx @@ -648,7 +648,7 @@ void SdTiledRenderingTest::testInsertDeletePage() }; // the document has 1 slide - CPPUNIT_ASSERT(pDoc->GetSdPageCount(PageKind::Standard) == 1); + CPPUNIT_ASSERT_EQUAL(static_cast(1), pDoc->GetSdPageCount(PageKind::Standard)); uno::Sequence aArgs; @@ -719,7 +719,7 @@ void SdTiledRenderingTest::testInsertDeletePage() } // the document has 1 slide - CPPUNIT_ASSERT(pDoc->GetSdPageCount(PageKind::Standard) == 1); + CPPUNIT_ASSERT_EQUAL(static_cast(1), pDoc->GetSdPageCount(PageKind::Standard)); comphelper::LibreOfficeKit::setActive(false); }