[runtime_image] Improve format logs (#19903)

Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
guillempages
2026-09-29 23:28:28 +02:00
committed by GitHub
co-authored by J. Nick Koston
parent 35d41adf86
commit 99c7f9e625
6 changed files with 37 additions and 7 deletions
@@ -0,0 +1,19 @@
#include <gtest/gtest.h>
#include "esphome/components/runtime_image/image_format.h"
namespace esphome::runtime_image::testing {
TEST(RuntimeImageFormatNames, FormatNames) {
EXPECT_STREQ(LOG_STR_ARG(get_format_name(AUTO)), "AUTO");
EXPECT_STREQ(LOG_STR_ARG(get_format_name(BMP)), "BMP");
EXPECT_STREQ(LOG_STR_ARG(get_format_name(JPEG)), "JPEG");
EXPECT_STREQ(LOG_STR_ARG(get_format_name(PNG)), "PNG");
EXPECT_STREQ(LOG_STR_ARG(get_format_name(QOI)), "QOI");
}
TEST(RuntimeImageFormatNames, OutOfRangeName) {
EXPECT_STREQ(LOG_STR_ARG(get_format_name(static_cast<ImageFormat>(254))), "UNKNOWN");
}
} // namespace esphome::runtime_image::testing
@@ -2,7 +2,7 @@
#include <optional>
#include "esphome/components/runtime_image/runtime_image.h"
#include "esphome/components/runtime_image/image_format.h"
namespace esphome::runtime_image::testing {