Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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
11TEST(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}
#define TEST(S, s, D, expected)
GAsyncResult * result
std::string HexEncode(std::string_view input)
Definition hex_codec.cc:14