summaryrefslogtreecommitdiffstats
path: root/lldb/unittests/Core/LogTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/unittests/Core/LogTest.cpp')
-rw-r--r--lldb/unittests/Core/LogTest.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/lldb/unittests/Core/LogTest.cpp b/lldb/unittests/Core/LogTest.cpp
index 0b9ed00bbba..16670aafce4 100644
--- a/lldb/unittests/Core/LogTest.cpp
+++ b/lldb/unittests/Core/LogTest.cpp
@@ -130,6 +130,20 @@ TEST_F(LogChannelTest, Enable) {
EXPECT_NE(nullptr, test_channel.GetLogIfAll(FOO | BAR));
}
+TEST_F(LogChannelTest, EnableOptions) {
+ EXPECT_EQ(nullptr, test_channel.GetLogIfAll(FOO));
+ std::string message;
+ std::shared_ptr<llvm::raw_string_ostream> stream_sp(
+ new llvm::raw_string_ostream(message));
+ StreamString err;
+ EXPECT_TRUE(Log::EnableLogChannel(stream_sp, LLDB_LOG_OPTION_VERBOSE, "chan",
+ nullptr, err));
+
+ Log *log = test_channel.GetLogIfAll(FOO);
+ ASSERT_NE(nullptr, log);
+ EXPECT_TRUE(log->GetVerbose());
+}
+
TEST_F(LogChannelTest, Disable) {
EXPECT_EQ(nullptr, test_channel.GetLogIfAll(FOO));
const char *cat12[] = {"foo", "bar", nullptr};
OpenPOWER on IntegriCloud