From 86bf291cbb3aeb8e9fe656c7a0362a015f714c28 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 13 Oct 2026 11:50:20 -1000 Subject: [PATCH] Expect the byte order constructor argument and compare the fallback colour without alpha --- tests/component_tests/image/test_init.py | 2 +- tests/components/image/test_image_draw.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/component_tests/image/test_init.py b/tests/component_tests/image/test_init.py index 4d62bb52a19..602b923a1dd 100644 --- a/tests/component_tests/image/test_init.py +++ b/tests/component_tests/image/test_init.py @@ -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 ) diff --git a/tests/components/image/test_image_draw.cpp b/tests/components/image/test_image_draw.cpp index 2e8cab00509..8c3d2760441 100644 --- a/tests/components/image/test_image_draw.cpp +++ b/tests/components/image/test_image_draw.cpp @@ -172,7 +172,9 @@ TEST(ImageDraw, FallbackKeepsRgbChannelOrder) { image.draw(0, 0, &display, Color::WHITE, Color::BLACK); ASSERT_EQ(display.pixels.size(), static_cast(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; } }