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

Noel Grandin noel at peralex.com
Thu Feb 4 10:29:23 UTC 2016


 vcl/qa/cppunit/canvasbitmaptest.cxx |   12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

New commits:
commit 42d868008d2b4c5b31c307f02e60ba94ddcd5678
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Feb 4 12:28:33 2016 +0200

    loplugin:fpcomparison
    
    Change-Id: I084b63d1085976838426f1157e0ba238e0520d7f

diff --git a/vcl/qa/cppunit/canvasbitmaptest.cxx b/vcl/qa/cppunit/canvasbitmaptest.cxx
index b093275..4a61cfe 100644
--- a/vcl/qa/cppunit/canvasbitmaptest.cxx
+++ b/vcl/qa/cppunit/canvasbitmaptest.cxx
@@ -156,9 +156,11 @@ void checkCanvasBitmap( const rtl::Reference<VclCanvasBitmap>& xBmp,
                             std::none_of(pRGBStart,pRGBEnd,&rangeCheck));
 
     CPPUNIT_ASSERT_MESSAGE( "First pixel is not white",
-                            pRGBStart[0].Red == 1.0 && pRGBStart[0].Green == 1.0 && pRGBStart[0].Blue == 1.0);
+                            rtl::math::approxEqual(pRGBStart[0].Red, 1.0) &&
+                            rtl::math::approxEqual(pRGBStart[0].Green, 1.0) &&
+                            rtl::math::approxEqual(pRGBStart[0].Blue, 1.0) );
     CPPUNIT_ASSERT_MESSAGE( "Second pixel is not opaque",
-                            pARGBStart[1].Alpha == 1.0);
+                            rtl::math::approxEqual(pARGBStart[1].Alpha, 1.0) );
     if( aContainedBmpEx.IsTransparent() )
     {
         CPPUNIT_ASSERT_MESSAGE( "First pixel is not fully transparent",
@@ -198,9 +200,9 @@ void checkCanvasBitmap( const rtl::Reference<VclCanvasBitmap>& xBmp,
     }
 
     CPPUNIT_ASSERT_MESSAGE( "150th pixel is not white",
-                            pRGBStart[150].Red == 1.0 &&
-                            pRGBStart[150].Green == 1.0 &&
-                            pRGBStart[150].Blue == 1.0);
+                            rtl::math::approxEqual(pRGBStart[150].Red, 1.0) &&
+                            rtl::math::approxEqual(pRGBStart[150].Green, 1.0) &&
+                            rtl::math::approxEqual(pRGBStart[150].Blue, 1.0) );
 
     if( nOriginalDepth > 8 )
     {


More information about the Libreoffice-commits mailing list