Flutter Linux Embedder
FlValueStringMatcher Class Reference

Public Types

using is_gtest_matcher = void
 

Public Member Functions

 FlValueStringMatcher (::testing::Matcher< std::string > value)
 
bool MatchAndExplain (GBytes *data, ::testing::MatchResultListener *result_listener) const
 
void DescribeTo (std::ostream *os) const
 
void DescribeNegationTo (std::ostream *os) const
 

Detailed Description

Definition at line 14 of file fl_window_state_monitor_test.cc.

Member Typedef Documentation

◆ is_gtest_matcher

Constructor & Destructor Documentation

◆ FlValueStringMatcher()

FlValueStringMatcher::FlValueStringMatcher ( ::testing::Matcher< std::string >  value)
inlineexplicit

Definition at line 18 of file fl_window_state_monitor_test.cc.

19  : value_(std::move(value)) {}

Member Function Documentation

◆ DescribeNegationTo()

void FlValueStringMatcher::DescribeNegationTo ( std::ostream *  os) const
inline

Definition at line 43 of file fl_window_state_monitor_test.cc.

43  {
44  *os << "value ";
45  value_.DescribeNegationTo(os);
46  }

◆ DescribeTo()

void FlValueStringMatcher::DescribeTo ( std::ostream *  os) const
inline

Definition at line 38 of file fl_window_state_monitor_test.cc.

38  {
39  *os << "value ";
40  value_.DescribeTo(os);
41  }

◆ MatchAndExplain()

bool FlValueStringMatcher::MatchAndExplain ( GBytes *  data,
::testing::MatchResultListener *  result_listener 
) const
inline

Definition at line 21 of file fl_window_state_monitor_test.cc.

22  {
23  g_autoptr(FlStringCodec) codec = fl_string_codec_new();
24  g_autoptr(GError) error = nullptr;
25  g_autoptr(FlValue) value =
26  fl_message_codec_decode_message(FL_MESSAGE_CODEC(codec), data, &error);
27  if (value == nullptr) {
28  *result_listener << ::testing::PrintToString(error->message);
29  return false;
30  }
31  if (!value_.MatchAndExplain(fl_value_get_string(value), result_listener)) {
32  *result_listener << " where the value doesn't match: \"" << value << "\"";
33  return false;
34  }
35  return true;
36  }

References error, fl_message_codec_decode_message(), fl_string_codec_new(), fl_value_get_string(), and value.


The documentation for this class was generated from the following file:
FlValue
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:42
fl_value_get_string
const G_MODULE_EXPORT gchar * fl_value_get_string(FlValue *self)
Definition: fl_value.cc:682
fl_message_codec_decode_message
G_MODULE_EXPORT FlValue * fl_message_codec_decode_message(FlMessageCodec *self, GBytes *message, GError **error)
Definition: fl_message_codec.cc:33
error
const uint8_t uint32_t uint32_t GError ** error
Definition: fl_pixel_buffer_texture_test.cc:40
fl_string_codec_new
G_MODULE_EXPORT FlStringCodec * fl_string_codec_new()
Definition: fl_string_codec.cc:53
value
uint8_t value
Definition: fl_standard_message_codec.cc:36