diff options
| author | Pavel Labath <labath@google.com> | 2017-02-27 11:05:39 +0000 |
|---|---|---|
| committer | Pavel Labath <labath@google.com> | 2017-02-27 11:05:39 +0000 |
| commit | 88d081b505395fbeb12181dd7e1aa00730779e7a (patch) | |
| tree | 825b8ef481823d3564569f55de20a3d9c5d1e052 /lldb/unittests/Core/LogTest.cpp | |
| parent | 6ac8403430c33aebdd88e5fa41921bc65265d180 (diff) | |
| download | bcm5719-llvm-88d081b505395fbeb12181dd7e1aa00730779e7a.tar.gz bcm5719-llvm-88d081b505395fbeb12181dd7e1aa00730779e7a.zip | |
Log: Fix a regression in handling log options
The channel refactor introduced a regression where we were not honoring
the log options passed when enabling the channel. Fix that and add a
test.
llvm-svn: 296329
Diffstat (limited to 'lldb/unittests/Core/LogTest.cpp')
| -rw-r--r-- | lldb/unittests/Core/LogTest.cpp | 14 |
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}; |

