From a04ccc9417bf1997d03e9863f321c1b1535fba8a Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Wed, 3 Aug 2016 20:07:55 +0200 Subject: fix loplugin:cppunitassertequals in chart2 Change-Id: Iefcbc438159046adef8fce216e5c9477e11e2931 Reviewed-on: https://gerrit.libreoffice.org/27841 Tested-by: Jenkins Reviewed-by: Markus Mohrhard --- chart2/qa/extras/chart2export.cxx | 10 +++++----- chart2/qa/extras/chart2import.cxx | 18 +++++++++--------- 2 files changed, 14 insertions(+), 14 deletions(-) (limited to 'chart2') diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx index e70fa9dc9eeb..5975c7a3cfa2 100644 --- a/chart2/qa/extras/chart2export.cxx +++ b/chart2/qa/extras/chart2export.cxx @@ -855,10 +855,10 @@ void Chart2ExportTest::testDataLabelBordersDOCX() CPPUNIT_ASSERT(xPropSet.is()); drawing::FillStyle eStyle = xPropSet->getPropertyValue("FillStyle").get(); sal_Int32 nColor = xPropSet->getPropertyValue("FillColor").get(); - CPPUNIT_ASSERT_MESSAGE("'Automatic' chart background fill in docx should be loaded as solid fill.", - eStyle == drawing::FillStyle_SOLID); - CPPUNIT_ASSERT_MESSAGE("'Automatic' chart background fill in docx should be loaded as solid white.", - (nColor & 0x00FFFFFF) == 0x00FFFFFF); // highest 2 bytes are transparency which we ignore here. + CPPUNIT_ASSERT_EQUAL_MESSAGE("'Automatic' chart background fill in docx should be loaded as solid fill.", + drawing::FillStyle_SOLID, eStyle); + CPPUNIT_ASSERT_EQUAL_MESSAGE("'Automatic' chart background fill in docx should be loaded as solid white.", + sal_Int32(0x00FFFFFF), sal_Int32(nColor & 0x00FFFFFF)); // highest 2 bytes are transparency which we ignore here. aTest.checkObject1(xChartDoc); xChartDoc.set(getChartDocFromWriter(1), uno::UNO_QUERY); @@ -982,7 +982,7 @@ void Chart2ExportTest::testDataLabelDefaultLineChartDOCX() sal_Int32 nLabelPlacement = -1; if (xPropSet->getPropertyValue("LabelPlacement") >>= nLabelPlacement) // This option may not be set. Check its value only when it's set. - CPPUNIT_ASSERT_MESSAGE("Line chart's default label placement should be 'right'.", nLabelPlacement == chart::DataLabelPlacement::RIGHT); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Line chart's default label placement should be 'right'.", chart::DataLabelPlacement::RIGHT, nLabelPlacement ); } void Chart2ExportTest::testBarChartRotation() diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx index a97b228230e1..7d0f8f204a6a 100644 --- a/chart2/qa/extras/chart2import.cxx +++ b/chart2/qa/extras/chart2import.cxx @@ -404,8 +404,8 @@ void Chart2ImportTest::testPPTXHiddenDataSeries() Reference xPropSet = xChartDoc->getPageBackground(); CPPUNIT_ASSERT(xPropSet.is()); drawing::FillStyle eStyle = xPropSet->getPropertyValue("FillStyle").get(); - CPPUNIT_ASSERT_MESSAGE("'Automatic' chart background fill in pptx should be loaded as no fill (transparent).", - eStyle == drawing::FillStyle_NONE); + CPPUNIT_ASSERT_EQUAL_MESSAGE("'Automatic' chart background fill in pptx should be loaded as no fill (transparent).", + drawing::FillStyle_NONE, eStyle); Reference xCT = getChartTypeFromDoc(xChartDoc, 0); CPPUNIT_ASSERT(xCT.is()); @@ -700,7 +700,7 @@ void Chart2ImportTest::testTransparentBackground(OUString const & filename) css::drawing::FillStyle aStyle; xPropSet -> getPropertyValue("FillStyle") >>= aStyle; - CPPUNIT_ASSERT_MESSAGE("Background needs to be with solid fill style", aStyle == 1); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Background needs to be with solid fill style", css::drawing::FillStyle_SOLID, aStyle); } // 2 test methods here so that tearDown() can dispose the document void Chart2ImportTest::testFdo54361() @@ -723,10 +723,10 @@ void Chart2ImportTest::testAutoBackgroundXLSX() CPPUNIT_ASSERT(xPropSet.is()); drawing::FillStyle eStyle = xPropSet->getPropertyValue("FillStyle").get(); sal_Int32 nColor = xPropSet->getPropertyValue("FillColor").get(); - CPPUNIT_ASSERT_MESSAGE("'Automatic' chart background fill in xlsx should be loaded as solid fill.", - eStyle == drawing::FillStyle_SOLID); - CPPUNIT_ASSERT_MESSAGE("'Automatic' chart background fill in xlsx should be loaded as solid white.", - (nColor & 0x00FFFFFF) == 0x00FFFFFF); // highest 2 bytes are transparency which we ignore here. + CPPUNIT_ASSERT_EQUAL_MESSAGE("'Automatic' chart background fill in xlsx should be loaded as solid fill.", + drawing::FillStyle_SOLID, eStyle); + CPPUNIT_ASSERT_EQUAL_MESSAGE("'Automatic' chart background fill in xlsx should be loaded as solid white.", + sal_Int32(0x00FFFFFF), sal_Int32(nColor & 0x00FFFFFF)); // highest 2 bytes are transparency which we ignore here. } void Chart2ImportTest::testChartAreaStyleBackgroundXLSX() @@ -740,8 +740,8 @@ void Chart2ImportTest::testChartAreaStyleBackgroundXLSX() CPPUNIT_ASSERT(xPropSet.is()); drawing::FillStyle eStyle = xPropSet->getPropertyValue("FillStyle").get(); sal_Int32 nColor = xPropSet->getPropertyValue("FillColor").get(); - CPPUNIT_ASSERT_MESSAGE("'Automatic' chart background fill in xlsx should be loaded as solid fill.", - eStyle == drawing::FillStyle_SOLID); + CPPUNIT_ASSERT_EQUAL_MESSAGE("'Automatic' chart background fill in xlsx should be loaded as solid fill.", + drawing::FillStyle_SOLID, eStyle); CPPUNIT_ASSERT_EQUAL_MESSAGE("'Automatic' chart background fill in xlsx should be loaded as solid white.", sal_Int32(0), nColor); } -- cgit