blob: 43564f804e0b78cf8313feccc25ff5ebdf4658f5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
#include <forstio/test/suite.hpp>
#include "../c++/data.hpp"
#include "../c++/base64.hpp"
namespace {
namespace sch {
using namespace saw::schema;
}
SAW_TEST("Base64 String"){
using namespace saw;
data<sch::String> inp_data{"Hello, World!"};
data<sch::String, encode::Base64> base64_str;
codec<sch::String, encode::Base64> base64_codec;
auto eov = base64_codec.encode(inp_data, base64_str);
SAW_EXPECT(eov.is_value(), "Couldn't encode data");
data<sch::String, encode::Base64> check_against{"SGVsbG8sIFdvcmxkIQ=="};
SAW_EXPECT(base64_str == check_against, "Base64 not expected value");
}
}
|