diff options
-rw-r--r-- | vcl/qa/cppunit/canvasbitmaptest.cxx | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/vcl/qa/cppunit/canvasbitmaptest.cxx b/vcl/qa/cppunit/canvasbitmaptest.cxx index 4a61cfe65663..ae47526b2405 100644 --- a/vcl/qa/cppunit/canvasbitmaptest.cxx +++ b/vcl/qa/cppunit/canvasbitmaptest.cxx @@ -155,12 +155,14 @@ void checkCanvasBitmap( const rtl::Reference<VclCanvasBitmap>& xBmp, CPPUNIT_ASSERT_MESSAGE( "rgb colors are not within [0,1] range", std::none_of(pRGBStart,pRGBEnd,&rangeCheck)); - CPPUNIT_ASSERT_MESSAGE( "First pixel is not white", - 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", - rtl::math::approxEqual(pARGBStart[1].Alpha, 1.0) ); + CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE( + "First pixel is not white", 1.0, pRGBStart[0].Red, 1E-12); + CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE( + "First pixel is not white", 1.0, pRGBStart[0].Green, 1E-12); + CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE( + "First pixel is not white", 1.0, pRGBStart[0].Blue, 1E-12); + CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE( + "Second pixel is not opaque", 1.0, pARGBStart[1].Alpha, 1E-12); if( aContainedBmpEx.IsTransparent() ) { CPPUNIT_ASSERT_MESSAGE( "First pixel is not fully transparent", @@ -199,10 +201,12 @@ void checkCanvasBitmap( const rtl::Reference<VclCanvasBitmap>& xBmp, xPal->getColorSpace().is()); } - CPPUNIT_ASSERT_MESSAGE( "150th pixel is not white", - rtl::math::approxEqual(pRGBStart[150].Red, 1.0) && - rtl::math::approxEqual(pRGBStart[150].Green, 1.0) && - rtl::math::approxEqual(pRGBStart[150].Blue, 1.0) ); + CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE( + "150th pixel is not white", 1.0, pRGBStart[150].Red, 1E-12); + CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE( + "150th pixel is not white", 1.0, pRGBStart[150].Green, 1E-12); + CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE( + "150th pixel is not white", 1.0, pRGBStart[150].Blue, 1E-12); if( nOriginalDepth > 8 ) { |