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) message = hex_string_to_bytes(hex_string);
37 g_autoptr(GError)
error =
nullptr;
40 EXPECT_EQ(
error,
nullptr);
41 EXPECT_NE(
value,
nullptr);
45 TEST(FlStringCodecTest, EncodeData) {
48 EXPECT_STREQ(hex_string,
"68656c6c6f");
51 TEST(FlStringCodecTest, EncodeEmpty) {
54 EXPECT_STREQ(hex_string,
"");
57 TEST(FlStringCodecTest, EncodeNullptr) {
62 TEST(FlStringCodecTest, EncodeUnknownType) {
68 TEST(FlStringCodecTest, DecodeData) {
74 TEST(FlStringCodecTest, DecodeEmpty) {
80 TEST(FlStringCodecTest, EncodeDecode) {
85 g_autoptr(GError)
error =
nullptr;
86 g_autoptr(GBytes) message =
88 EXPECT_NE(message,
nullptr);
89 EXPECT_EQ(
error,
nullptr);
93 EXPECT_EQ(
error,
nullptr);
94 EXPECT_NE(output,
nullptr);