From b5808454959008f7e5f9090b7c8064ea28b84071 Mon Sep 17 00:00:00 2001 From: DDoSolitary Date: Wed, 21 Oct 2026 23:27:52 +0800 Subject: [PATCH] Fix test build error on arm On arm char is unsigned and narrowing conversion from signed value during list-initialization is strictly ill-formed. --- test/binary_test.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/binary_test.cpp b/test/binary_test.cpp index 93c999bb0..55539bfa3 100644 --- a/test/binary_test.cpp +++ b/test/binary_test.cpp @@ -1,4 +1,5 @@ #include "gtest/gtest.h" +#include #include TEST(BinaryTest, DecodingSimple) { @@ -7,11 +8,13 @@ TEST(BinaryTest, DecodingSimple) { EXPECT_EQ(std::string(result.begin(), result.end()), "deadbeef"); } +#if CHAR_MIN < 0 TEST(BinaryTest, DecodingNoCrashOnNegative) { std::string input{-58, -1, -99, 109}; const std::vector &result = YAML::DecodeBase64(input); EXPECT_TRUE(result.empty()); } +#endif TEST(BinaryTest, DecodingTooShort) { std::string input{90, 71, 86, 104, 90, 71, 74, 108, 90, 87, 89};