180814287SRaphael Isemann //===-- EventTest.cpp -----------------------------------------------------===// 2181b823bSPavel Labath // 32946cd70SChandler Carruth // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 42946cd70SChandler Carruth // See https://llvm.org/LICENSE.txt for license information. 52946cd70SChandler Carruth // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6181b823bSPavel Labath // 7181b823bSPavel Labath //===----------------------------------------------------------------------===// 8181b823bSPavel Labath 9181b823bSPavel Labath #include "lldb/Utility/Event.h" 10181b823bSPavel Labath #include "lldb/Utility/StreamString.h" 11181b823bSPavel Labath #include "gtest/gtest.h" 12181b823bSPavel Labath 13181b823bSPavel Labath using namespace lldb_private; 14181b823bSPavel Labath to_string(const EventDataBytes & E)15181b823bSPavel Labathstatic std::string to_string(const EventDataBytes &E) { 16181b823bSPavel Labath StreamString S; 17181b823bSPavel Labath E.Dump(&S); 18*777180a3SBenjamin Kramer return std::string(S.GetString()); 19181b823bSPavel Labath } 20181b823bSPavel Labath TEST(EventTest,DumpEventDataBytes)21181b823bSPavel LabathTEST(EventTest, DumpEventDataBytes) { 22181b823bSPavel Labath EXPECT_EQ(R"("foo")", to_string(EventDataBytes("foo"))); 23181b823bSPavel Labath EXPECT_EQ("01 02 03", to_string(EventDataBytes("\x01\x02\x03"))); 24181b823bSPavel Labath } 25