8#include "gtest/gtest.h"
16 auto test = [](
const std::string&
input,
const std::string& output) {
21 std::string actual(
buffer, len);
22 ASSERT_STREQ(actual.c_str(), output.c_str());
25 test(
"apple",
"YXBwbGU=");
26 test(
"BANANA",
"QkFOQU5B");
27 test(
"Cherry Pie",
"Q2hlcnJ5IFBpZQ==");
28 test(
"fLoCcInAuCiNiHiLiPiLiFiCaTiOn",
29 "ZkxvQ2NJbkF1Q2lOaUhpTGlQaUxpRmlDYVRpT24=");
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==");
63 auto test = [](
const std::string&
input,
const std::string& output) {
69 std::string actual(
buffer, len);
70 ASSERT_STREQ(actual.c_str(), output.c_str());
73 test(
"ZGF0ZQ==",
"date");
74 test(
"RWdncGxhbnQ=",
"Eggplant");
75 test(
"RmlzaCAmIENoaXBz",
"Fish & Chips");
76 test(
"U3VQZVJjQWxJZlJhR2lMaVN0SWNFeFBpQWxJZE9jSW9Vcw==",
77 "SuPeRcAlIfRaGiLiStIcExPiAlIdOcIoUs");
80 test(
"Y X Bwb GU=",
"apple");
88 ASSERT_EQ(err, expectedError) <<
input;
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 < static_cast<int>(len);
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));
#define FML_CHECK(condition)
TEST(NativeAssetsManagerTest, NoAvailableAssets)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set profile Make the profiler discard new samples once the profiler sample buffer is full When this flag is not the profiler sample buffer is used as a ring buffer
static size_t Encode(const void *src, size_t length, void *dst)
static Error Decode(const void *src, size_t srcLength, void *dst, size_t *dstLength)
static size_t EncodedSize(size_t srcDataLength)