[Libreoffice-commits] core.git: sd/qa
Miklos Vajna
vmiklos at collabora.co.uk
Fri Oct 28 09:14:37 UTC 2016
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(-)
New commits:
commit ddb4600cd0672a1df8a8ca916c89fd1d2be407af
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Fri Oct 28 09:04:39 2016 +0200
sd: fix loplugin:cppunitassertequals warnings
Change-Id: Id2dc5762668b7c3f78f0a0a1ede97d4ac63fab5d
diff --git a/sd/qa/unit/export-tests-ooxml1.cxx b/sd/qa/unit/export-tests-ooxml1.cxx
index db2d760..8f2ef49 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<const SvxFontHeightItem *>((*it).pAttr);
if( pFontHeight )
- CPPUNIT_ASSERT_MESSAGE( "Font height is wrong", pFontHeight->GetHeight() == 1129 );
+ CPPUNIT_ASSERT_EQUAL_MESSAGE( "Font height is wrong", static_cast<sal_uInt32>(1129), pFontHeight->GetHeight() );
const SvxFontItem *pFont = dynamic_cast<const SvxFontItem *>((*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<const SvxWeightItem *>((*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 014720e..3f28823 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<sal_Int32>(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<drawing::XDrawPagesSupplier> xDrawPagesSupplier(xDocShRef->GetModel(), uno::UNO_QUERY);
- CPPUNIT_ASSERT_MESSAGE( sFailedMessage.getStr(), xDrawPagesSupplier->getDrawPages()->getCount() == 2 );
+ CPPUNIT_ASSERT_EQUAL_MESSAGE( sFailedMessage.getStr(), static_cast<sal_Int32>(2), xDrawPagesSupplier->getDrawPages()->getCount());
uno::Reference< drawing::XDrawPage > xDrawPage( xDrawPagesSupplier->getDrawPages()->getByIndex(0), uno::UNO_QUERY_THROW );
uno::Reference<drawing::XShape> xImage(xDrawPage->getByIndex(2), uno::UNO_QUERY);
@@ -449,7 +449,7 @@ void SdExportTest::testImageWithSpecialID()
// Check whether graphic was exported well
uno::Reference<drawing::XDrawPagesSupplier> xDrawPagesSupplier(xDocShRef->GetModel(), uno::UNO_QUERY);
- CPPUNIT_ASSERT_MESSAGE( sFailedMessage.getStr(), xDrawPagesSupplier->getDrawPages()->getCount() == 2 );
+ CPPUNIT_ASSERT_EQUAL_MESSAGE( sFailedMessage.getStr(), static_cast<sal_Int32>(2), xDrawPagesSupplier->getDrawPages()->getCount() );
uno::Reference< drawing::XDrawPage > xDrawPage( xDrawPagesSupplier->getDrawPages()->getByIndex(0), uno::UNO_QUERY_THROW );
uno::Reference<drawing::XShape> xImage(xDrawPage->getByIndex(2), uno::UNO_QUERY);
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index c85fda8..1d0eef1 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 049b956..f930df8 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<sal_uInt16>(1), pDoc->GetSdPageCount(PageKind::Standard));
uno::Sequence<beans::PropertyValue> 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<sal_uInt16>(1), pDoc->GetSdPageCount(PageKind::Standard));
comphelper::LibreOfficeKit::setActive(false);
}
More information about the Libreoffice-commits
mailing list