summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-08-03 20:07:55 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-08-03 23:55:18 +0000
commita04ccc9417bf1997d03e9863f321c1b1535fba8a (patch)
tree213bcd3ff57b286351938aafe00de94e0ea3aeb6 /chart2
parent8da4ba9be2d2deb8990f40fa0cc5d6b16d525c72 (diff)
fix loplugin:cppunitassertequals in chart2
Change-Id: Iefcbc438159046adef8fce216e5c9477e11e2931 Reviewed-on: https://gerrit.libreoffice.org/27841 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'chart2')
-rw-r--r--chart2/qa/extras/chart2export.cxx10
-rw-r--r--chart2/qa/extras/chart2import.cxx18
2 files changed, 14 insertions, 14 deletions
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<drawing::FillStyle>();
sal_Int32 nColor = xPropSet->getPropertyValue("FillColor").get<sal_Int32>();
- 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<beans::XPropertySet> xPropSet = xChartDoc->getPageBackground();
CPPUNIT_ASSERT(xPropSet.is());
drawing::FillStyle eStyle = xPropSet->getPropertyValue("FillStyle").get<drawing::FillStyle>();
- 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<chart2::XChartType> 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<drawing::FillStyle>();
sal_Int32 nColor = xPropSet->getPropertyValue("FillColor").get<sal_Int32>();
- 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<drawing::FillStyle>();
sal_Int32 nColor = xPropSet->getPropertyValue("FillColor").get<sal_Int32>();
- 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);
}