Flutter Engine
The Flutter Engine
fml
hex_codec_unittest.cc
Go to the documentation of this file.
1
// Copyright 2013 The Flutter Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file.
4
5
#include "flutter/fml/hex_codec.h"
6
7
#include <iostream>
8
9
#include "gtest/gtest.h"
10
11
TEST
(HexCodecTest, CanEncode) {
12
{
13
auto
result
=
fml::HexEncode
(
"hello"
);
14
ASSERT_EQ(
result
,
"68656c6c6f"
);
15
}
16
17
{
18
auto
result
=
fml::HexEncode
(
""
);
19
ASSERT_EQ(
result
,
""
);
20
}
21
22
{
23
auto
result
=
fml::HexEncode
(
"1"
);
24
ASSERT_EQ(
result
,
"31"
);
25
}
26
27
{
28
auto
result
=
fml::HexEncode
(std::string_view(
"\xFF\xFE\x00\x01"
, 4));
29
ASSERT_EQ(
result
,
"fffe0001"
);
30
}
31
}
result
GAsyncResult * result
Definition:
fl_text_input_plugin.cc:106
TEST
TEST(HexCodecTest, CanEncode)
Definition:
hex_codec_unittest.cc:11
fml::HexEncode
std::string HexEncode(std::string_view input)
Definition:
hex_codec.cc:14
Generated on Sun Jun 23 2024 21:54:58 for Flutter Engine by
1.9.4