5#include "flutter/shell/platform/linux/public/flutter_linux/fl_method_response.h"
6#include "gtest/gtest.h"
8TEST(FlMethodResponseTest, Success) {
10 g_autoptr(FlMethodSuccessResponse) response =
17TEST(FlMethodResponseTest, Error) {
18 g_autoptr(FlMethodErrorResponse) response =
25TEST(FlMethodResponseTest, ErrorMessage) {
26 g_autoptr(FlMethodErrorResponse) response =
33TEST(FlMethodResponseTest, ErrorDetails) {
35 g_autoptr(FlMethodErrorResponse) response =
44TEST(FlMethodResponseTest, ErrorMessageAndDetails) {
46 g_autoptr(FlMethodErrorResponse) response =
55TEST(FlMethodResponseTest, NotImplemented) {
56 g_autoptr(FlMethodNotImplementedResponse) response =
60 EXPECT_TRUE(FL_IS_METHOD_NOT_IMPLEMENTED_RESPONSE(response));
63TEST(FlMethodResponseTest, SuccessGetResult) {
65 g_autoptr(FlMethodSuccessResponse) response =
67 g_autoptr(GError)
error =
nullptr;
70 ASSERT_NE(
result,
nullptr);
71 EXPECT_EQ(
error,
nullptr);
76TEST(FlMethodResponseTest, ErrorGetResult) {
77 g_autoptr(FlMethodErrorResponse) response =
79 g_autoptr(GError)
error =
nullptr;
82 EXPECT_EQ(
result,
nullptr);
87TEST(FlMethodResponseTest, NotImplementedGetResult) {
88 g_autoptr(FlMethodNotImplementedResponse) response =
90 g_autoptr(GError)
error =
nullptr;
93 EXPECT_EQ(
result,
nullptr);
G_MODULE_EXPORT FlValue * fl_method_response_get_result(FlMethodResponse *self, GError **error)
G_MODULE_EXPORT FlValue * fl_method_success_response_get_result(FlMethodSuccessResponse *self)
G_MODULE_EXPORT FlMethodErrorResponse * fl_method_error_response_new(const gchar *code, const gchar *message, FlValue *details)
G_MODULE_EXPORT const gchar * fl_method_error_response_get_message(FlMethodErrorResponse *self)
G_MODULE_EXPORT FlMethodSuccessResponse * fl_method_success_response_new(FlValue *result)
G_MODULE_EXPORT FlValue * fl_method_error_response_get_details(FlMethodErrorResponse *self)
G_MODULE_EXPORT const gchar * fl_method_error_response_get_code(FlMethodErrorResponse *self)
G_MODULE_EXPORT FlMethodNotImplementedResponse * fl_method_not_implemented_response_new()
@ FL_METHOD_RESPONSE_ERROR_NOT_IMPLEMENTED
@ FL_METHOD_RESPONSE_ERROR_REMOTE_ERROR
#define FL_METHOD_RESPONSE_ERROR
TEST(FlMethodResponseTest, Success)
const uint8_t uint32_t uint32_t GError ** error
G_MODULE_EXPORT FlValue * fl_value_new_int(int64_t value)
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
typedefG_BEGIN_DECLS struct _FlValue FlValue
#define EXPECT_TRUE(handle)