1 //===-- EventTest.cpp -------------------------------------------*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 #include "lldb/Utility/Event.h" 11 #include "lldb/Utility/StreamString.h" 12 #include "gtest/gtest.h" 13 14 using namespace lldb_private; 15 16 static std::string to_string(const EventDataBytes &E) { 17 StreamString S; 18 E.Dump(&S); 19 return S.GetString(); 20 } 21 22 TEST(EventTest, DumpEventDataBytes) { 23 EXPECT_EQ(R"("foo")", to_string(EventDataBytes("foo"))); 24 EXPECT_EQ("01 02 03", to_string(EventDataBytes("\x01\x02\x03"))); 25 } 26