From: Adrian McCarthy Date: Wed, 12 Aug 2020 20:50:28 +0000 (-0700) Subject: [lldb] Fix unit test parsing to handle CR+LF as well as LF X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7ddfb956e1a5ee91d0d30f33ca0c84faeb471db4;p=platform%2Fupstream%2Fllvm.git [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. --- 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();