[Libreoffice-commits] core.git: vcl/qa
Chris Sherlock
chris.sherlock79 at gmail.com
Sun Feb 25 06:04:23 UTC 2018
vcl/qa/cppunit/BitmapTest.cxx | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
New commits:
commit 99223fc736c55cc1eb319ae1576b3998771e6b6f
Author: Chris Sherlock <chris.sherlock79 at gmail.com>
Date: Sun Feb 25 04:51:32 2018 +1100
vcl: add some basic Bitmap tests
Change-Id: Ib697f0499cd40b44eab154794c227574cf831eef
Reviewed-on: https://gerrit.libreoffice.org/50282
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
diff --git a/vcl/qa/cppunit/BitmapTest.cxx b/vcl/qa/cppunit/BitmapTest.cxx
index 02bf3c2b9f25..22b8893a8328 100644
--- a/vcl/qa/cppunit/BitmapTest.cxx
+++ b/vcl/qa/cppunit/BitmapTest.cxx
@@ -33,17 +33,39 @@ namespace
class BitmapTest : public CppUnit::TestFixture
{
+ void testCreation();
void testConvert();
void testScale();
void testCRC();
CPPUNIT_TEST_SUITE(BitmapTest);
+ CPPUNIT_TEST(testCreation);
CPPUNIT_TEST(testConvert);
CPPUNIT_TEST(testScale);
CPPUNIT_TEST(testCRC);
CPPUNIT_TEST_SUITE_END();
};
+void BitmapTest::testCreation()
+{
+ {
+ Bitmap aBmp;
+ Size aSize = aBmp.GetSizePixel();
+ CPPUNIT_ASSERT_EQUAL(static_cast<long>(0), aSize.Width());
+ CPPUNIT_ASSERT_EQUAL(static_cast<long>(0), aSize.Height());
+ CPPUNIT_ASSERT(aBmp.IsEmpty());
+ }
+
+ {
+ Bitmap aBmp(Size(10, 10), 8);
+ Size aSize = aBmp.GetSizePixel();
+ CPPUNIT_ASSERT_EQUAL(static_cast<long>(10), aSize.Width());
+ CPPUNIT_ASSERT_EQUAL(static_cast<long>(10), aSize.Height());
+ CPPUNIT_ASSERT(!aBmp.IsEmpty());
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(8), aBmp.GetBitCount());
+ }
+}
+
void BitmapTest::testConvert()
{
Bitmap aBitmap(Size(10, 10), 8);
More information about the Libreoffice-commits
mailing list