diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2018-02-25 04:51:32 +1100 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2018-02-25 07:04:03 +0100 |
commit | 99223fc736c55cc1eb319ae1576b3998771e6b6f (patch) | |
tree | 57b78c19e2205ac82ed2b2061d7024aba2122081 /vcl | |
parent | 0081a0d9465bf1f26d68cff10f2cfc9a662f8824 (diff) |
vcl: add some basic Bitmap tests
Change-Id: Ib697f0499cd40b44eab154794c227574cf831eef
Reviewed-on: https://gerrit.libreoffice.org/50282
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/qa/cppunit/BitmapTest.cxx | 22 |
1 files changed, 22 insertions, 0 deletions
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); |