Skip to content

Commit

Permalink
Use wxAlphaPixelData for default native bitmaps in the unit test
Browse files Browse the repository at this point in the history
The unit test added in 607b800 didn't work on
the systems using 32 bpp screens, i.e. almost all of them, because it tried to
use 24 bpp wxNativePixelData with them.

Fix this by using wxAlphaPixelData, which won't work on non 32 bpp systems,
and so is still not ideal, but at least makes the test work on most systems by
default.

See #17666.
  • Loading branch information
vadz committed Jan 3, 2017
1 parent e3c245c commit 092e772
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/graphics/bitmap.cpp
Expand Up @@ -110,8 +110,8 @@ void BitmapTestCase::OverlappingBlit()

// Now, lines 0 and 1 should be red, lines 2++ should still be white.

wxNativePixelData npd( m_bmp );
wxNativePixelData::Iterator it( npd );
wxAlphaPixelData npd( m_bmp );
wxAlphaPixelData::Iterator it( npd );

ASSERT_EQUAL_RGB( it, 255, 0, 0 );
it.OffsetY( npd, 1 );
Expand Down

1 comment on commit 092e772

@a-wi
Copy link
Contributor

@a-wi a-wi commented on 092e772 Apr 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, under wxGTK3 default color depth of wxBitmap is 24 bpp and with wxAlphaPixelData this unit test crashes with segfault.

Please sign in to comment.