[Libreoffice-commits] core.git: vcl/qa
Tomaž Vajngerl (via logerrit)
logerrit at kemper.freedesktop.org
Fri Mar 26 07:28:43 UTC 2021
vcl/qa/cppunit/BmpFilterTest.cxx | 10 ++++++++++
1 file changed, 10 insertions(+)
New commits:
commit 5ea16544186752e1345427d448882a7ce65ad6f1
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Thu Mar 25 21:24:15 2021 +0900
Commit: Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Fri Mar 26 08:28:01 2021 +0100
vcl: Check expected PixelFormat in BMP tests
Change-Id: I256ceac6d9634c83ce8895d865bfe76cc8e046c9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113135
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
diff --git a/vcl/qa/cppunit/BmpFilterTest.cxx b/vcl/qa/cppunit/BmpFilterTest.cxx
index 1b38e6c3193f..5cc2abac3d54 100644
--- a/vcl/qa/cppunit/BmpFilterTest.cxx
+++ b/vcl/qa/cppunit/BmpFilterTest.cxx
@@ -36,6 +36,7 @@ CPPUNIT_TEST_FIXTURE(BmpFilterTest, testBMP_RGB_888)
auto aBitmap = aGraphic.GetBitmapEx();
CPPUNIT_ASSERT_EQUAL(tools::Long(10), aBitmap.GetSizePixel().Width());
CPPUNIT_ASSERT_EQUAL(tools::Long(10), aBitmap.GetSizePixel().Height());
+ CPPUNIT_ASSERT_EQUAL(vcl::PixelFormat::N24_BPP, aBitmap.getPixelFormat());
CPPUNIT_ASSERT_EQUAL(COL_WHITE, aBitmap.GetPixelColor(0, 0));
CPPUNIT_ASSERT_EQUAL(COL_WHITE, aBitmap.GetPixelColor(9, 9));
CPPUNIT_ASSERT_EQUAL(Color(0x72, 0xd1, 0xc8), aBitmap.GetPixelColor(1, 1));
@@ -50,6 +51,7 @@ CPPUNIT_TEST_FIXTURE(BmpFilterTest, testBMP_RGB_565)
auto aBitmap = aGraphic.GetBitmapEx();
CPPUNIT_ASSERT_EQUAL(tools::Long(10), aBitmap.GetSizePixel().Width());
CPPUNIT_ASSERT_EQUAL(tools::Long(10), aBitmap.GetSizePixel().Height());
+ CPPUNIT_ASSERT_EQUAL(vcl::PixelFormat::N24_BPP, aBitmap.getPixelFormat());
// White is not completely white
//CPPUNIT_ASSERT_EQUAL(Color(0xf8, 0xfc, 0xf8), aBitmap.GetPixelColor(0, 0));
@@ -82,6 +84,7 @@ CPPUNIT_TEST_FIXTURE(BmpFilterTest, testBMP_Paint_24_RGB_888)
auto aBitmap = aGraphic.GetBitmapEx();
CPPUNIT_ASSERT_EQUAL(tools::Long(4), aBitmap.GetSizePixel().Width());
CPPUNIT_ASSERT_EQUAL(tools::Long(4), aBitmap.GetSizePixel().Height());
+ CPPUNIT_ASSERT_EQUAL(vcl::PixelFormat::N24_BPP, aBitmap.getPixelFormat());
CPPUNIT_ASSERT_EQUAL(COL_LIGHTBLUE, aBitmap.GetPixelColor(0, 0));
CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, aBitmap.GetPixelColor(2, 0));
@@ -97,6 +100,7 @@ CPPUNIT_TEST_FIXTURE(BmpFilterTest, testBMP_Index_1BPP)
auto aBitmap = aGraphic.GetBitmapEx();
CPPUNIT_ASSERT_EQUAL(tools::Long(4), aBitmap.GetSizePixel().Width());
CPPUNIT_ASSERT_EQUAL(tools::Long(4), aBitmap.GetSizePixel().Height());
+ CPPUNIT_ASSERT_EQUAL(vcl::PixelFormat::N1_BPP, aBitmap.getPixelFormat());
CPPUNIT_ASSERT_EQUAL(COL_BLACK, aBitmap.GetPixelColor(0, 0));
CPPUNIT_ASSERT_EQUAL(COL_BLACK, aBitmap.GetPixelColor(0, 2));
@@ -112,6 +116,7 @@ CPPUNIT_TEST_FIXTURE(BmpFilterTest, testBMP_Index_4BPP)
auto aBitmap = aGraphic.GetBitmapEx();
CPPUNIT_ASSERT_EQUAL(tools::Long(4), aBitmap.GetSizePixel().Width());
CPPUNIT_ASSERT_EQUAL(tools::Long(4), aBitmap.GetSizePixel().Height());
+ CPPUNIT_ASSERT_EQUAL(vcl::PixelFormat::N4_BPP, aBitmap.getPixelFormat());
CPPUNIT_ASSERT_EQUAL(COL_LIGHTBLUE, aBitmap.GetPixelColor(0, 0));
CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, aBitmap.GetPixelColor(2, 0));
@@ -127,6 +132,7 @@ CPPUNIT_TEST_FIXTURE(BmpFilterTest, testBMP_Index_8BPP)
auto aBitmap = aGraphic.GetBitmapEx();
CPPUNIT_ASSERT_EQUAL(tools::Long(4), aBitmap.GetSizePixel().Width());
CPPUNIT_ASSERT_EQUAL(tools::Long(4), aBitmap.GetSizePixel().Height());
+ CPPUNIT_ASSERT_EQUAL(vcl::PixelFormat::N8_BPP, aBitmap.getPixelFormat());
CPPUNIT_ASSERT_EQUAL(COL_LIGHTBLUE, aBitmap.GetPixelColor(0, 0));
CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, aBitmap.GetPixelColor(2, 0));
@@ -142,6 +148,7 @@ CPPUNIT_TEST_FIXTURE(BmpFilterTest, testBMP_Index_8BPP_RLE)
auto aBitmap = aGraphic.GetBitmapEx();
CPPUNIT_ASSERT_EQUAL(tools::Long(4), aBitmap.GetSizePixel().Width());
CPPUNIT_ASSERT_EQUAL(tools::Long(4), aBitmap.GetSizePixel().Height());
+ CPPUNIT_ASSERT_EQUAL(vcl::PixelFormat::N8_BPP, aBitmap.getPixelFormat());
CPPUNIT_ASSERT_EQUAL(COL_LIGHTBLUE, aBitmap.GetPixelColor(0, 0));
CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, aBitmap.GetPixelColor(2, 0));
@@ -157,6 +164,7 @@ CPPUNIT_TEST_FIXTURE(BmpFilterTest, testBMP_V4)
auto aBitmap = aGraphic.GetBitmapEx();
CPPUNIT_ASSERT_EQUAL(tools::Long(4), aBitmap.GetSizePixel().Width());
CPPUNIT_ASSERT_EQUAL(tools::Long(4), aBitmap.GetSizePixel().Height());
+ CPPUNIT_ASSERT_EQUAL(vcl::PixelFormat::N8_BPP, aBitmap.getPixelFormat());
CPPUNIT_ASSERT_EQUAL(COL_LIGHTBLUE, aBitmap.GetPixelColor(0, 0));
CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, aBitmap.GetPixelColor(2, 0));
@@ -172,6 +180,7 @@ CPPUNIT_TEST_FIXTURE(BmpFilterTest, testBMP_V3)
auto aBitmap = aGraphic.GetBitmapEx();
CPPUNIT_ASSERT_EQUAL(tools::Long(4), aBitmap.GetSizePixel().Width());
CPPUNIT_ASSERT_EQUAL(tools::Long(4), aBitmap.GetSizePixel().Height());
+ CPPUNIT_ASSERT_EQUAL(vcl::PixelFormat::N8_BPP, aBitmap.getPixelFormat());
CPPUNIT_ASSERT_EQUAL(COL_LIGHTBLUE, aBitmap.GetPixelColor(0, 0));
CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, aBitmap.GetPixelColor(2, 0));
@@ -187,6 +196,7 @@ CPPUNIT_TEST_FIXTURE(BmpFilterTest, testBMP_V2)
auto aBitmap = aGraphic.GetBitmapEx();
CPPUNIT_ASSERT_EQUAL(tools::Long(4), aBitmap.GetSizePixel().Width());
CPPUNIT_ASSERT_EQUAL(tools::Long(4), aBitmap.GetSizePixel().Height());
+ CPPUNIT_ASSERT_EQUAL(vcl::PixelFormat::N8_BPP, aBitmap.getPixelFormat());
CPPUNIT_ASSERT_EQUAL(COL_LIGHTBLUE, aBitmap.GetPixelColor(0, 0));
CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, aBitmap.GetPixelColor(2, 0));
More information about the Libreoffice-commits
mailing list