本文整理汇总了C++中StreamGDBRemote::Flush方法的典型用法代码示例。如果您正苦于以下问题:C++ StreamGDBRemote::Flush方法的具体用法?C++ StreamGDBRemote::Flush怎么用?C++ StreamGDBRemote::Flush使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StreamGDBRemote
的用法示例。
在下文中一共展示了StreamGDBRemote::Flush方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SendCPacket
TEST_F(GDBRemoteClientBaseTest, SendContinueDelegateStructuredDataReceipt) {
// Build the plain-text version of the JSON data we will have the
// server send.
const std::string json_payload =
"{ \"type\": \"MyFeatureType\", "
" \"elements\": [ \"entry1\", \"entry2\" ] }";
const std::string json_packet = "JSON-async:" + json_payload;
// Escape it properly for transit.
StreamGDBRemote stream;
stream.PutEscapedBytes(json_packet.c_str(), json_packet.length());
stream.Flush();
StringExtractorGDBRemote response;
// Send async structured data packet, then stop.
ASSERT_EQ(PacketResult::Success, server.SendPacket(stream.GetData()));
ASSERT_EQ(PacketResult::Success, server.SendPacket("T01"));
ASSERT_EQ(eStateStopped, SendCPacket(response));
ASSERT_EQ("T01", response.GetStringRef());
ASSERT_EQ(1ul, delegate.structured_data_packets.size());
// Verify the packet contents. It should have been unescaped upon packet
// reception.
ASSERT_EQ(json_packet, delegate.structured_data_packets[0]);
}