diff options
Diffstat (limited to 'lldb/unittests/Utility/LogTest.cpp')
| -rw-r--r-- | lldb/unittests/Utility/LogTest.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/lldb/unittests/Utility/LogTest.cpp b/lldb/unittests/Utility/LogTest.cpp index 81fdce6efa3..e4e5002a7f8 100644 --- a/lldb/unittests/Utility/LogTest.cpp +++ b/lldb/unittests/Utility/LogTest.cpp @@ -225,12 +225,17 @@ TEST_F(LogChannelEnabledTest, log_options) { EXPECT_EQ(1, sscanf(Msg.str().c_str(), "%d Hello World", &seq_no)); } - EXPECT_TRUE(EnableChannel(getStream(), LLDB_LOG_OPTION_PREPEND_FILE_FUNCTION, - "chan", {}, Err)); - EXPECT_EQ( - "LogTest.cpp:logAndTakeOutput Hello " - "World\n", - logAndTakeOutput("Hello World")); + { + EXPECT_TRUE(EnableChannel(getStream(), LLDB_LOG_OPTION_PREPEND_FILE_FUNCTION, + "chan", {}, Err)); + llvm::StringRef Msg = logAndTakeOutput("Hello World"); + char File[12]; + char Function[17]; + + sscanf(Msg.str().c_str(), "%[^:]:%s Hello World", File, Function); + EXPECT_STRCASEEQ("LogTest.cpp", File); + EXPECT_STREQ("logAndTakeOutput", Function); + } EXPECT_TRUE(EnableChannel( getStream(), LLDB_LOG_OPTION_PREPEND_PROC_AND_THREAD, "chan", {}, Err)); |

