Expect the byte order constructor argument and compare the fallback colour without alpha

This commit is contained in:
J. Nick Koston
2026-10-13 21:57:50 -10:00
parent 89f0d978ef
commit 86bf291cbb
2 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -745,7 +745,7 @@ def test_image_generation(
in main_cpp
)
assert (
"new(cat_img) image::Image(uint8_t_id, 32, 24, image::IMAGE_TYPE_RGB565, image::TRANSPARENCY_OPAQUE);"
"new(cat_img) image::Image(uint8_t_id, 32, 24, image::IMAGE_TYPE_RGB565, image::TRANSPARENCY_OPAQUE, false);"
in main_cpp
)
+3 -1
View File
@@ -172,7 +172,9 @@ TEST(ImageDraw, FallbackKeepsRgbChannelOrder) {
image.draw(0, 0, &display, Color::WHITE, Color::BLACK);
ASSERT_EQ(display.pixels.size(), static_cast<size_t>(W * H));
for (const auto &pixel : display.pixels) {
EXPECT_EQ(pixel.raw, image.get_pixel(pixel.x, pixel.y).raw_32) << "at " << pixel.x << "," << pixel.y;
// get_pixel() reports an opaque pixel with alpha set; the fallback decodes colour only
const Color expected = image.get_pixel(pixel.x, pixel.y);
EXPECT_EQ(pixel.raw, Color(expected.r, expected.g, expected.b).raw_32) << "at " << pixel.x << "," << pixel.y;
}
}