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);
G_MODULE_EXPORT GBytes * fl_message_codec_encode_message(FlMessageCodec *self, FlValue *message, GError **error)
G_MODULE_EXPORT FlValue * fl_message_codec_decode_message(FlMessageCodec *self, GBytes *message, GError **error)
@ FL_MESSAGE_CODEC_ERROR_UNSUPPORTED_TYPE
#define FL_MESSAGE_CODEC_ERROR
const uint8_t uint32_t uint32_t GError ** error
G_MODULE_EXPORT FlStringCodec * fl_string_codec_new()
static gchar * encode_message(FlValue *value)
static void encode_message_error(FlValue *value, GQuark domain, int code)
TEST(FlStringCodecTest, EncodeData)
static FlValue * decode_message(const char *hex_string)
G_MODULE_EXPORT FlValue * fl_value_new_string(const gchar *value)
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
G_MODULE_EXPORT FlValue * fl_value_ref(FlValue *self)
G_MODULE_EXPORT FlValue * fl_value_new_null()
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
G_MODULE_EXPORT const gchar * fl_value_get_string(FlValue *self)
typedefG_BEGIN_DECLS struct _FlValue FlValue