[Libreoffice-commits] core.git: chart2/qa

Markus Mohrhard markus.mohrhard at googlemail.com
Wed Aug 3 23:55:50 UTC 2016


 chart2/qa/extras/chart2export.cxx |   10 +++++-----
 chart2/qa/extras/chart2import.cxx |   18 +++++++++---------
 2 files changed, 14 insertions(+), 14 deletions(-)

New commits:
commit a04ccc9417bf1997d03e9863f321c1b1535fba8a
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Wed Aug 3 20:07:55 2016 +0200

    fix loplugin:cppunitassertequals in chart2
    
    Change-Id: Iefcbc438159046adef8fce216e5c9477e11e2931
    Reviewed-on: https://gerrit.libreoffice.org/27841
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx
index e70fa9d..5975c7a 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 a97b2282..7d0f8f2 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);
 }


More information about the Libreoffice-commits mailing list