summaryrefslogtreecommitdiff
path: root/unittests/Utility/EventTest.cpp
blob: 57e934ba8e421904b21e232fa674b6bdb7493020 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
//===-- EventTest.cpp -------------------------------------------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#include "lldb/Utility/Event.h"
#include "lldb/Utility/StreamString.h"
#include "gtest/gtest.h"

using namespace lldb_private;

static std::string to_string(const EventDataBytes &E) {
  StreamString S;
  E.Dump(&S);
  return S.GetString();
}

TEST(EventTest, DumpEventDataBytes) {
  EXPECT_EQ(R"("foo")", to_string(EventDataBytes("foo")));
  EXPECT_EQ("01 02 03", to_string(EventDataBytes("\x01\x02\x03")));
}