From ec63dc2c35fbfdb282565907482b9e1070562901 Mon Sep 17 00:00:00 2001 From: Francis Visoiu Mistrih Date: Fri, 26 Jul 2019 22:36:20 +0000 Subject: [PATCH] [Remarks] Update unit test to use StringRef::lower llvm-svn: 367161 --- llvm/unittests/Remarks/YAMLRemarksParsingTest.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/llvm/unittests/Remarks/YAMLRemarksParsingTest.cpp b/llvm/unittests/Remarks/YAMLRemarksParsingTest.cpp index d821049..aec2e97 100644 --- a/llvm/unittests/Remarks/YAMLRemarksParsingTest.cpp +++ b/llvm/unittests/Remarks/YAMLRemarksParsingTest.cpp @@ -63,14 +63,6 @@ bool parseExpectError(const char (&Buf)[N], const char *Error) { return StringRef(Stream.str()).contains(Error); } -static std::string toLower(StringRef S) { - std::string R; - R.reserve(S.size()); - for (char C : S) - R += std::tolower(C); - return R; -} - void parseExpectErrorMeta(StringRef Buf, const char *Error) { std::string ErrorStr; raw_string_ostream Stream(ErrorStr); @@ -82,7 +74,7 @@ void parseExpectErrorMeta(StringRef Buf, const char *Error) { // Use a case insensitive comparision due to case differences in error strings // for different OSs. - EXPECT_EQ(toLower(Stream.str()), toLower(Error)); + EXPECT_EQ(StringRef(Stream.str()).lower(), StringRef(Error).lower()); } TEST(YAMLRemarks, ParsingEmpty) { -- 2.7.4