diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-02-04 11:58:16 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-02-04 11:58:16 +0100 |
commit | d33c002c474a034db9ad7390aec7ced113dcfb3e (patch) | |
tree | 556c362405ebbcfe919ba36eec682e9e1087c2e1 /vcl/qa | |
parent | 9b6cc4f4092b23d62c552d8d14ce887d4e77b31f (diff) |
Use CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE
Change-Id: I2f6da8bb39ebd791f0bd3aa955dfc8c83b96ca04
Diffstat (limited to 'vcl/qa')
-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 ) { |