34 auto test = [](
const uint8_t input[],
size_t num,
const std::string& output) {
39 std::string actual(
buffer, len);
40 ASSERT_STREQ(actual.c_str(), output.c_str());
43 uint8_t e[] = {0x02, 0x71, 0x82, 0x81, 0x82, 0x84, 0x59};
44 test(e,
sizeof(e),
"AnGCgYKEWQ==");
46 uint8_t pi[] = {0x03, 0x24, 0x3F, 0x6A, 0x88, 0x85};
47 test(pi,
sizeof(pi),
"AyQ/aoiF");
50 for (
int i = 0; i < 256; i++) {
53 test(bytes,
sizeof(bytes),
54 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gIS"
55 "IjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFV"
56 "WV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJ"
57 "iouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq+wsbKztLW2t7i5uru8v"
58 "b6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t/g4eLj5OXm5+jp6uvs7e7v8P"
59 "Hy8/T19vf4+fr7/P3+/w==");
102 auto test = [](
const std::string& input,
const uint8_t output[],
size_t num) {
108 ASSERT_EQ(num, len) << input;
109 for (
int i = 0; i <
int(len); i++) {
110 ASSERT_EQ(uint8_t(
buffer[i]), output[i]) << input << i;
114 uint8_t e[] = {0x02, 0x71, 0x82, 0x81, 0x82, 0x84, 0x59};
115 test(
"AnGCgYKEWQ==", e,
sizeof(e));
117 uint8_t pi[] = {0x03, 0x24, 0x3F, 0x6A, 0x88, 0x85};
118 test(
"AyQ/aoiF", pi,
sizeof(pi));