diff options
author | Jan Holesovsky <kendy@collabora.com> | 2016-05-20 11:23:06 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2016-05-20 11:24:44 +0200 |
commit | 8626cafa3a08088fb310fe6ecf2906208e068a3a (patch) | |
tree | 28ac8edeacbdf4ad9e94869c096df1d1b69a3b77 | |
parent | f9461c1ede15ee00688fec434cd4d0a9407f4771 (diff) |
cairo svp: Sync the vcl unit tests with master.
BitmapTest.cxx was copied from master and adapted. BitmapFilterTest.cxx was
removed in master, so I just updated the expected values.
Change-Id: I8d6c158115d4a64e4336e7f83163aa5aaeef8a17
-rw-r--r-- | vcl/qa/cppunit/BitmapFilterTest.cxx | 4 | ||||
-rw-r--r-- | vcl/qa/cppunit/BitmapTest.cxx | 22 |
2 files changed, 11 insertions, 15 deletions
diff --git a/vcl/qa/cppunit/BitmapFilterTest.cxx b/vcl/qa/cppunit/BitmapFilterTest.cxx index e0cf3ef1ca8a..a8e712922b19 100644 --- a/vcl/qa/cppunit/BitmapFilterTest.cxx +++ b/vcl/qa/cppunit/BitmapFilterTest.cxx @@ -102,8 +102,8 @@ void BitmapFilterTest::testBlurCorrectness() } // Check blurred bitmap parameters - CPPUNIT_ASSERT_EQUAL(static_cast<long>(45), aBitmap24Bit.GetSizePixel().Width()); - CPPUNIT_ASSERT_EQUAL(static_cast<long>(35), aBitmap24Bit.GetSizePixel().Height()); + CPPUNIT_ASSERT_EQUAL(static_cast<long>(41), aBitmap24Bit.GetSizePixel().Width()); + CPPUNIT_ASSERT_EQUAL(static_cast<long>(31), aBitmap24Bit.GetSizePixel().Height()); CPPUNIT_ASSERT_EQUAL(nBPP, aBitmap24Bit.GetBitCount()); diff --git a/vcl/qa/cppunit/BitmapTest.cxx b/vcl/qa/cppunit/BitmapTest.cxx index a5437c179e3b..69f030ebb356 100644 --- a/vcl/qa/cppunit/BitmapTest.cxx +++ b/vcl/qa/cppunit/BitmapTest.cxx @@ -51,17 +51,13 @@ void BitmapTest::testConvert() { Bitmap::ScopedReadAccess pReadAccess(aBitmap); CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(8), pReadAccess->GetBitCount()); -#if defined WNT +#if defined MACOSX || defined IOS + //it would be nice to find and change the stride for quartz to be the same as everyone else + CPPUNIT_ASSERT_EQUAL(static_cast<sal_uLong>(10), pReadAccess->GetScanlineSize()); +#else if (!OpenGLHelper::isVCLOpenGLEnabled()) - { - // GDI Scanlines padded to DWORD multiples, it seems CPPUNIT_ASSERT_EQUAL(static_cast<sal_uLong>(12), pReadAccess->GetScanlineSize()); - } - else #endif - { - CPPUNIT_ASSERT_EQUAL(static_cast<sal_uLong>(10), pReadAccess->GetScanlineSize()); - } CPPUNIT_ASSERT(pReadAccess->HasPalette()); const BitmapColor& rColor = pReadAccess->GetPaletteColor(pReadAccess->GetPixelIndex(1, 1)); CPPUNIT_ASSERT_EQUAL(sal_Int32(204), sal_Int32(rColor.GetRed())); @@ -74,13 +70,13 @@ void BitmapTest::testConvert() CPPUNIT_ASSERT_EQUAL(sal_uInt16(24), aBitmap.GetBitCount()); { Bitmap::ScopedReadAccess pReadAccess(aBitmap); -#if defined LINUX - // 24 bit Bitmap on SVP backend uses 32bit BGRX format +#if defined LINUX || defined FREEBSD + // 24 bit Bitmap on SVP backend uses 32bit BGRA format CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(32), pReadAccess->GetBitCount()); CPPUNIT_ASSERT_EQUAL(sal_uLong(40), pReadAccess->GetScanlineSize()); #else CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(24), pReadAccess->GetBitCount()); -#if defined WNT +#if defined(_WIN32) if (!OpenGLHelper::isVCLOpenGLEnabled()) { // GDI Scanlines padded to DWORD multiples, it seems @@ -178,7 +174,7 @@ void BitmapTest::testCRC() { CRCHash aCRCs; - Bitmap aBitmap(Size(1023,759), 24, 0); + Bitmap aBitmap(Size(1023,759), 24, nullptr); aBitmap.Erase(COL_BLACK); checkAndInsert(aCRCs, aBitmap, "black bitmap"); aBitmap.Invert(); @@ -188,7 +184,7 @@ void BitmapTest::testCRC() aVDev->SetBackground(Wallpaper(COL_WHITE)); aVDev->SetOutputSizePixel(Size(1023, 759)); -#if 0 // disabled for now - it breaks on OS/X and Windows +#if 0 // disabled for now - oddly breaks on OS/X - but why ? Bitmap aWhiteCheck = getAsBitmap(aVDev); CPPUNIT_ASSERT(aCRCs.find(aWhiteCheck.GetChecksum()) != aCRCs.end()); #endif |