diff options
author | Noel Grandin <noel@peralex.com> | 2016-02-04 12:28:33 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-02-04 12:28:57 +0200 |
commit | 42d868008d2b4c5b31c307f02e60ba94ddcd5678 (patch) | |
tree | f0bab4bb3497153c31396b875db689ceebd96658 /vcl/qa | |
parent | bbcb4c94034f9ea51b63682912a3183777292bbd (diff) |
loplugin:fpcomparison
Change-Id: I084b63d1085976838426f1157e0ba238e0520d7f
Diffstat (limited to 'vcl/qa')
-rw-r--r-- | vcl/qa/cppunit/canvasbitmaptest.cxx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/vcl/qa/cppunit/canvasbitmaptest.cxx b/vcl/qa/cppunit/canvasbitmaptest.cxx index b093275d921c..4a61cfe65663 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 ) { |