Browse Source

Common: Bitmap base: catch copy segfault

Copying an empty image is not checked for nullity,
so it will segfault. Introduce a test for this case,
for fixing as a follow-up.
pull/15/head
John Beard 7 years ago
parent
commit
d642ac39ae
  1. 14
      qa/common/test_bitmap_base.cpp

14
qa/common/test_bitmap_base.cpp

@ -113,6 +113,20 @@ BOOST_AUTO_TEST_CASE( Empty )
}
#ifdef HAVE_EXPECTED_FAILURES
BOOST_AUTO_TEST_CASE( EmptyCopy, *boost::unit_test::expected_failures( 1 ) )
{
BITMAP_BASE empty;
BITMAP_BASE copied = empty;
// should still have nothing in it
BOOST_CHECK_EQUAL( copied.GetImageData(), nullptr );
}
#endif
struct TEST_PIXEL_CASE
{
int m_x;

Loading…
Cancel
Save