aboutsummaryrefslogtreecommitdiff
path: root/unittests/Utility/EventTest.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2019-01-19 10:06:29 +0000
committerDimitry Andric <dim@FreeBSD.org>2019-01-19 10:06:29 +0000
commit94994d372d014ce4c8758b9605d63fae651bd8aa (patch)
tree51c0b708bd59f205d6b35cb2a8c24d62f0c33d77 /unittests/Utility/EventTest.cpp
parent39be7ce23363d12ae3e49aeb1fdb2bfeb892e836 (diff)
Diffstat (limited to 'unittests/Utility/EventTest.cpp')
-rw-r--r--unittests/Utility/EventTest.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/unittests/Utility/EventTest.cpp b/unittests/Utility/EventTest.cpp
new file mode 100644
index 000000000000..57e934ba8e42
--- /dev/null
+++ b/unittests/Utility/EventTest.cpp
@@ -0,0 +1,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")));
+}