From 4830fc4e408aba8be923b876a837de08e4a035f4 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 21 Jul 2024 11:11:02 -0700 Subject: [PATCH] Added more 8-bit blit test coverage --- test/testautomation_surface.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/test/testautomation_surface.c b/test/testautomation_surface.c index 022e097a87..64d15c64dd 100644 --- a/test/testautomation_surface.c +++ b/test/testautomation_surface.c @@ -1139,6 +1139,18 @@ static int surface_testPalette(void *arg) SDL_BlitSurface(source, NULL, surface, NULL); SDLTest_AssertCheck(*pixels == 1, "Expected *pixels == 1 got %u", *pixels); + /* Identity copy between indexed surfaces where the source has a palette */ + palette->colors[0].r = 0; + palette->colors[0].g = 0; + palette->colors[0].b = 0; + palette->colors[1].r = 0xFF; + palette->colors[1].g = 0; + palette->colors[1].b = 0; + SDL_SetSurfacePalette(source, palette); + *pixels = 0; + SDL_BlitSurface(source, NULL, surface, NULL); + SDLTest_AssertCheck(*pixels == 1, "Expected *pixels == 1 got %u", *pixels); + /* Identity copy between indexed surfaces where the destination has a palette */ palette->colors[0].r = 0; palette->colors[0].g = 0; @@ -1146,6 +1158,20 @@ static int surface_testPalette(void *arg) palette->colors[1].r = 0xFF; palette->colors[1].g = 0; palette->colors[1].b = 0; + SDL_SetSurfacePalette(source, NULL); + SDL_SetSurfacePalette(surface, palette); + *pixels = 0; + SDL_BlitSurface(source, NULL, surface, NULL); + SDLTest_AssertCheck(*pixels == 1, "Expected *pixels == 1 got %u", *pixels); + + /* Identity copy between indexed surfaces where the source and destination share a palette */ + palette->colors[0].r = 0; + palette->colors[0].g = 0; + palette->colors[0].b = 0; + palette->colors[1].r = 0xFF; + palette->colors[1].g = 0; + palette->colors[1].b = 0; + SDL_SetSurfacePalette(source, palette); SDL_SetSurfacePalette(surface, palette); *pixels = 0; SDL_BlitSurface(source, NULL, surface, NULL);