Select the bitmap out of wxDC before using it in the unit test

The unit test added in 607b800444 had a bug as
it tried to use the bitmap directly while it was still selected into a
wxMemoryDC, which wasn't guaranteed to work and resulted in an assert.

Fix this by destroying wxMemoryDC earlier.

See #17666.
This commit is contained in:
Vadim Zeitlin 2017-01-03 02:50:26 +01:00
parent 4b4c572d5f
commit e3c245c226

View File

@ -93,7 +93,7 @@ void BitmapTestCase::OverlappingBlit()
m_bmp.SetMask( NULL );
// Clear to white.
{
wxMemoryDC dc(m_bmp);
dc.SetBackground( *wxWHITE );
dc.Clear();
@ -106,6 +106,7 @@ void BitmapTestCase::OverlappingBlit()
// Scroll down one line.
dc.Blit( 0, 1, 10, 9, &dc, 0, 0 );
} // Select the bitmap out of the memory DC before using it directly.
// Now, lines 0 and 1 should be red, lines 2++ should still be white.