brintos

brintos / llvm-project-archived public Read only

0
0
Text · 793 B · 5f8f2b5 Raw
25 lines · cpp
1//===-- EventTest.cpp -----------------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9#include "lldb/Utility/Event.h"10#include "lldb/Utility/StreamString.h"11#include "gtest/gtest.h"12 13using namespace lldb_private;14 15static std::string to_string(const EventDataBytes &E) {16  StreamString S;17  E.Dump(&S);18  return std::string(S.GetString());19}20 21TEST(EventTest, DumpEventDataBytes) {22  EXPECT_EQ(R"("foo")", to_string(EventDataBytes("foo")));23  EXPECT_EQ("01 02 03", to_string(EventDataBytes("\x01\x02\x03")));24}25