Kaydet (Commit) d33c002c authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Use CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE

Change-Id: I2f6da8bb39ebd791f0bd3aa955dfc8c83b96ca04
üst 9b6cc4f4
......@@ -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 )
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment