mirror of
https://github.com/esphome/esphome.git
synced 2026-10-01 08:50:22 +00:00
[runtime_image] Improve format logs (#19903)
Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
co-authored by
J. Nick Koston
parent
35d41adf86
commit
99c7f9e625
@@ -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 {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user