6 #include "flutter/shell/platform/linux/testing/fl_test.h"
7 #include "gtest/gtest.h"
13 g_autoptr(GError)
error =
nullptr;
14 g_autoptr(GBytes) message =
16 EXPECT_NE(message,
nullptr);
17 EXPECT_EQ(
error,
nullptr);
19 return bytes_to_hex_string(message);
25 g_autoptr(GError)
error =
nullptr;
26 g_autoptr(GBytes) message =
28 EXPECT_EQ(message,
nullptr);
29 EXPECT_TRUE(g_error_matches(
error, domain, code));
36 g_autoptr(GBytes) data = hex_string_to_bytes(hex_string);
37 g_autoptr(GError)
error =
nullptr;
40 EXPECT_EQ(
error,
nullptr);
41 EXPECT_NE(
value,
nullptr);
45 TEST(FlBinaryCodecTest, EncodeData) {
46 uint8_t data[] = {0x00, 0x01, 0x02, 0xFD, 0xFE, 0xFF};
49 EXPECT_STREQ(hex_string,
"000102fdfeff");
52 TEST(FlBinaryCodecTest, EncodeEmpty) {
55 EXPECT_STREQ(hex_string,
"");
58 TEST(FlBinaryCodecTest, EncodeNullptr) {
63 TEST(FlBinaryCodecTest, EncodeUnknownType) {
69 TEST(FlBinaryCodecTest, DecodeData) {
81 TEST(FlBinaryCodecTest, DecodeEmpty) {
87 TEST(FlBinaryCodecTest, EncodeDecode) {
90 uint8_t data[] = {0x00, 0x01, 0x02, 0xFD, 0xFE, 0xFF};
93 g_autoptr(GError)
error =
nullptr;
94 g_autoptr(GBytes) message =
96 EXPECT_NE(message,
nullptr);
97 EXPECT_EQ(
error,
nullptr);
101 EXPECT_EQ(
error,
nullptr);
102 EXPECT_NE(output,
nullptr);