vcl/qa/cppunit/BitmapTest.cxx | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
New commits: commit 99223fc736c55cc1eb319ae1576b3998771e6b6f Author: Chris Sherlock <chris.sherloc...@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 <c...@libreoffice.org> Reviewed-by: Tomaž Vajngerl <qui...@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); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits