1#define BOOST_TEST_MODULE base64
2#include <boost/test/included/unit_test.hpp>
8using namespace std::literals;
10BOOST_AUTO_TEST_SUITE(base64)
13 auto input =
"abc123$&()'?\xb4\xf5\x01\xfa~a"s;
14 auto expected_output =
"YWJjMTIzJCYoKSc/tPUB+n5h"s;
20 auto input =
"abc123$&()'?\xb4\xf5\x01\xfa~a"s;
21 auto expected_output =
"YWJjMTIzJCYoKSc_tPUB-n5h"s;
27 auto input =
"YWJjMTIzJCYoKSc/tPUB+n5h"s;
28 auto expected_output =
"abc123$&()'?\xb4\xf5\x01\xfa~a"s;
34 auto input =
"YWJjMTIzJCYoKSc_tPUB-n5h"s;
35 auto expected_output =
"abc123$&()'?\xb4\xf5\x01\xfa~a"s;
41 auto input =
"YWJjMTIzJCYoKSc/tPUB+n5h========="s;
42 auto expected_output =
"abc123$&()'?\xb4\xf5\x01\xfa~a"s;
48 auto input =
"YWJjMTIzJCYoKSc/tPU$B+n5h="s;
51 return e.
to_detail_string().find(
"encountered non-base64 character") != std::string::npos;
55BOOST_AUTO_TEST_SUITE_END()
Used to generate a useful error report when an exception is thrown.
std::string to_detail_string(log_level ll=log_level::all) const
Defines exception's used by fc.
std::string base64_encode(unsigned char const *bytes_to_encode, unsigned int in_len)
std::string base64url_encode(unsigned char const *bytes_to_encode, unsigned int in_len)
std::string base64url_decode(const std::string &encoded_string)
std::string base64_decode(const std::string &encoded_string)
BOOST_AUTO_TEST_CASE(base64enc)