首次提交

This commit is contained in:
2026-07-01 10:02:29 +08:00
commit 05c6fc6232
627 changed files with 238188 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
#include "gtest/gtest.h"
#include <yaml-cpp/binary.h>
TEST(BinaryTest, DecodingSimple) {
std::string input{90, 71, 86, 104, 90, 71, 74, 108, 90, 87, 89, 61};
const std::vector<unsigned char> &result = YAML::DecodeBase64(input);
EXPECT_EQ(std::string(result.begin(), result.end()), "deadbeef");
}
TEST(BinaryTest, DecodingNoCrashOnNegative) {
std::string input{-58, -1, -99, 109};
const std::vector<unsigned char> &result = YAML::DecodeBase64(input);
EXPECT_TRUE(result.empty());
}
TEST(BinaryTest, DecodingTooShort) {
std::string input{90, 71, 86, 104, 90, 71, 74, 108, 90, 87, 89};
const std::vector<unsigned char> &result = YAML::DecodeBase64(input);
EXPECT_TRUE(result.empty());
}