summaryrefslogtreecommitdiff
path: root/vcl/qa
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-10-08 11:40:55 +0200
committerStephan Bergmann <sbergman@redhat.com>2020-06-16 14:29:48 +0200
commitea45b306d824938d2dc01e6988be210c3a042efe (patch)
treec51b537043720c2d22235bbf97a2fdfc2d126d12 /vcl/qa
parent9da104538dd92861b2b9e4e95ccbafe12632fe83 (diff)
Document that accessing an empty bitmap is legal
It no longer triggers an assert in --enable-assert-always-abort builds since 2293aa3a15a0fc0566c0e15872fdc215d0ab2fe6 "Remove dubious assert 'Forbidden Access to empty bitmap!'". Change-Id: I1c50b7f167fa1e1ba0b465934eabd195285abd4b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/80437 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'vcl/qa')
-rw-r--r--vcl/qa/cppunit/BitmapTest.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/vcl/qa/cppunit/BitmapTest.cxx b/vcl/qa/cppunit/BitmapTest.cxx
index 640c477e3515..02d9fdf2cd56 100644
--- a/vcl/qa/cppunit/BitmapTest.cxx
+++ b/vcl/qa/cppunit/BitmapTest.cxx
@@ -48,6 +48,7 @@ class BitmapTest : public CppUnit::TestFixture
void testErase();
void testBitmap32();
void testOctree();
+ void testEmptyAccess();
CPPUNIT_TEST_SUITE(BitmapTest);
CPPUNIT_TEST(testCreation);
@@ -62,6 +63,7 @@ class BitmapTest : public CppUnit::TestFixture
CPPUNIT_TEST(testErase);
CPPUNIT_TEST(testBitmap32);
CPPUNIT_TEST(testOctree);
+ CPPUNIT_TEST(testEmptyAccess);
CPPUNIT_TEST_SUITE_END();
};
@@ -651,6 +653,14 @@ void BitmapTest::testOctree()
}
}
+void BitmapTest::testEmptyAccess()
+{
+ Bitmap empty;
+ BitmapInfoAccess access(empty);
+ CPPUNIT_ASSERT_EQUAL(long(0), access.Width());
+ CPPUNIT_ASSERT_EQUAL(long(0), access.Height());
+}
+
} // namespace
CPPUNIT_TEST_SUITE_REGISTRATION(BitmapTest);