From 7ddfb956e1a5ee91d0d30f33ca0c84faeb471db4 Mon Sep 17 00:00:00 2001 From: Adrian McCarthy Date: Wed, 12 Aug 2020 13:50:28 -0700 Subject: [PATCH] [lldb] Fix unit test parsing to handle CR+LF as well as LF Apparently when the strings are created, the `'\n'` is converted to the platform's natural new line indicator, which is CR+LF on Windows. But upon reading back with `sscanf`, the CRs caused a matching failure. --- lldb/unittests/Utility/TimerTest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lldb/unittests/Utility/TimerTest.cpp b/lldb/unittests/Utility/TimerTest.cpp index 2d323c0..c6d1fac 100644 --- a/lldb/unittests/Utility/TimerTest.cpp +++ b/lldb/unittests/Utility/TimerTest.cpp @@ -97,7 +97,7 @@ TEST(TimerTest, CategoryTimesStats) { int count1, count2; ASSERT_EQ( 6, sscanf(ss.GetData(), - "%lf sec (total: %lfs; child: %lfs; count: %d) for CAT1%*[\n ]" + "%lf sec (total: %lfs; child: %lfs; count: %d) for CAT1%*[\n\r ]" "%lf sec (total: %*fs; child: %*fs; count: %d) for CAT2", &seconds1, &total1, &child1, &count1, &seconds2, &count2)) << "String: " << ss.GetData(); -- 2.7.4