| 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-exception |
| 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | |
| 9 | #include "lldb/Utility/Event.h" |
| 10 | #include "lldb/Utility/StreamString.h" |
| 11 | #include "gtest/gtest.h" |
| 12 | |
| 13 | using namespace lldb_private; |
| 14 | |
| 15 | static std::string to_string(const EventDataBytes &E) { |
| 16 | StreamString S; |
| 17 | E.Dump(s: &S); |
| 18 | return std::string(S.GetString()); |
| 19 | } |
| 20 | |
| 21 | TEST(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 |
