5#include "flutter/shell/platform/linux/public/flutter_linux/fl_string_codec.h"
6#include "flutter/shell/platform/linux/testing/fl_test.h"
7#include "gtest/gtest.h"
13 g_autoptr(GError)
error =
nullptr;
17 EXPECT_EQ(
error,
nullptr);
25 g_autoptr(GError)
error =
nullptr;
37 g_autoptr(GError)
error =
nullptr;
40 EXPECT_EQ(
error,
nullptr);
41 EXPECT_NE(
value,
nullptr);
45TEST(FlStringCodecTest, EncodeData) {
48 EXPECT_STREQ(hex_string,
"68656c6c6f");
51TEST(FlStringCodecTest, EncodeEmpty) {
54 EXPECT_STREQ(hex_string,
"");
57TEST(FlStringCodecTest, EncodeNullptr) {
62TEST(FlStringCodecTest, EncodeUnknownType) {
68TEST(FlStringCodecTest, DecodeData) {
74TEST(FlStringCodecTest, DecodeEmpty) {
80TEST(FlStringCodecTest, EncodeDecode) {
85 g_autoptr(GError)
error =
nullptr;
89 EXPECT_EQ(
error,
nullptr);
93 EXPECT_EQ(
error,
nullptr);
94 EXPECT_NE(
output,
nullptr);
G_MODULE_EXPORT FlValue * fl_message_codec_decode_message(FlMessageCodec *self, GBytes *message, GError **error)
G_MODULE_EXPORT GBytes * fl_message_codec_encode_message(FlMessageCodec *self, FlValue *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 FlValue * decode_message(const char *hex_string)
static void encode_message_error(FlValue *value, GQuark domain, int code)
TEST(FlStringCodecTest, EncodeData)
static gchar * encode_message(FlValue *value)
GBytes * hex_string_to_bytes(const gchar *hex_string)
gchar * bytes_to_hex_string(GBytes *bytes)
G_MODULE_EXPORT FlValue * fl_value_ref(FlValue *self)
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
G_MODULE_EXPORT FlValue * fl_value_new_null()
G_MODULE_EXPORT FlValue * fl_value_new_string(const gchar *value)
G_MODULE_EXPORT const gchar * fl_value_get_string(FlValue *self)
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
typedefG_BEGIN_DECLS struct _FlValue FlValue
#define EXPECT_TRUE(handle)