diff options
author | Brad King <brad.king@kitware.com> | 2018-08-09 11:59:48 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-08-09 12:00:03 (GMT) |
commit | 75844dd6092418ba4353352dfc172d5f5588a553 (patch) | |
tree | ff62edccfba19c8513170dca39b981f7a8aa6e24 /Source/CTest | |
parent | 34334c098f85004242f109857193f5f8cdce697d (diff) | |
parent | 69ca85cc7faf937d6d9d1dc1a27e062cd7765b1f (diff) | |
download | CMake-75844dd6092418ba4353352dfc172d5f5588a553.zip CMake-75844dd6092418ba4353352dfc172d5f5588a553.tar.gz CMake-75844dd6092418ba4353352dfc172d5f5588a553.tar.bz2 |
Merge topic 'cleanup-find-cstr'
69ca85cc7f Remove unnecessary c_str() in RegularExpression::find calls
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2271
Diffstat (limited to 'Source/CTest')
-rw-r--r-- | Source/CTest/cmCTestBuildHandler.cxx | 2 | ||||
-rw-r--r-- | Source/CTest/cmCTestCoverageHandler.cxx | 16 | ||||
-rw-r--r-- | Source/CTest/cmCTestLaunch.cxx | 2 | ||||
-rw-r--r-- | Source/CTest/cmCTestRunTest.cxx | 10 | ||||
-rw-r--r-- | Source/CTest/cmCTestTestHandler.cxx | 6 |
5 files changed, 18 insertions, 18 deletions
diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx index 65844bd..3f6654b 100644 --- a/Source/CTest/cmCTestBuildHandler.cxx +++ b/Source/CTest/cmCTestBuildHandler.cxx @@ -589,7 +589,7 @@ void cmCTestBuildHandler::GenerateXMLLogScraped(cmXMLWriter& xml) for (cmCTestCompileErrorWarningRex& rit : this->ErrorWarningFileLineRegex) { cmsys::RegularExpression* re = &rit.RegularExpression; - if (re->find(cm->Text.c_str())) { + if (re->find(cm->Text)) { cm->SourceFile = re->match(rit.FileIndex); // At this point we need to make this->SourceFile relative to // the source root of the project, so cvs links will work diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx index 43a2bae..1d9a5f7 100644 --- a/Source/CTest/cmCTestCoverageHandler.cxx +++ b/Source/CTest/cmCTestCoverageHandler.cxx @@ -1075,7 +1075,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage( if (line.empty()) { // Ignore empty line; probably style 2 - } else if (st1re1.find(line.c_str())) { + } else if (st1re1.find(line)) { if (gcovStyle == 0) { gcovStyle = 1; } @@ -1088,7 +1088,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage( actualSourceFile.clear(); sourceFile = st1re1.match(2); - } else if (st1re2.find(line.c_str())) { + } else if (st1re2.find(line)) { if (gcovStyle == 0) { gcovStyle = 1; } @@ -1100,7 +1100,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage( } gcovFile = st1re2.match(1); - } else if (st2re1.find(line.c_str())) { + } else if (st2re1.find(line)) { if (gcovStyle == 0) { gcovStyle = 2; } @@ -1113,7 +1113,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage( actualSourceFile.clear(); sourceFile = st2re1.match(1); - } else if (st2re2.find(line.c_str())) { + } else if (st2re2.find(line)) { if (gcovStyle == 0) { gcovStyle = 2; } @@ -1123,7 +1123,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage( cont->Error++; break; } - } else if (st2re3.find(line.c_str())) { + } else if (st2re3.find(line)) { if (gcovStyle == 0) { gcovStyle = 2; } @@ -1135,7 +1135,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage( } gcovFile = st2re3.match(2); - } else if (st2re4.find(line.c_str())) { + } else if (st2re4.find(line)) { if (gcovStyle == 0) { gcovStyle = 2; } @@ -1150,7 +1150,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage( "Warning: " << st2re4.match(1) << " had unexpected EOF" << std::endl, this->Quiet); - } else if (st2re5.find(line.c_str())) { + } else if (st2re5.find(line)) { if (gcovStyle == 0) { gcovStyle = 2; } @@ -1165,7 +1165,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage( "Warning: Cannot open file: " << st2re5.match(1) << std::endl, this->Quiet); - } else if (st2re6.find(line.c_str())) { + } else if (st2re6.find(line)) { if (gcovStyle == 0) { gcovStyle = 2; } diff --git a/Source/CTest/cmCTestLaunch.cxx b/Source/CTest/cmCTestLaunch.cxx index 09addeb..6cd1c09 100644 --- a/Source/CTest/cmCTestLaunch.cxx +++ b/Source/CTest/cmCTestLaunch.cxx @@ -584,7 +584,7 @@ bool cmCTestLaunch::Match(std::string const& line, std::vector<cmsys::RegularExpression>& regexps) { for (cmsys::RegularExpression& r : regexps) { - if (r.find(line.c_str())) { + if (r.find(line)) { return true; } } diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index 927797a..ef0a49d 100644 --- a/Source/CTest/cmCTestRunTest.cxx +++ b/Source/CTest/cmCTestRunTest.cxx @@ -49,7 +49,7 @@ void cmCTestRunTest::CheckOutput(std::string const& line) // Check for TIMEOUT_AFTER_MATCH property. if (!this->TestProperties->TimeoutRegularExpressions.empty()) { for (auto& reg : this->TestProperties->TimeoutRegularExpressions) { - if (reg.first.find(this->ProcessOutput.c_str())) { + if (reg.first.find(this->ProcessOutput)) { cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, this->GetIndex() << ": " @@ -148,7 +148,7 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started) this->FailedDependencies.empty()) { bool found = false; for (auto& pass : this->TestProperties->RequiredRegularExpressions) { - if (pass.first.find(this->ProcessOutput.c_str())) { + if (pass.first.find(this->ProcessOutput)) { found = true; reason = "Required regular expression found."; break; @@ -168,7 +168,7 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started) if (!this->TestProperties->ErrorRegularExpressions.empty() && this->FailedDependencies.empty()) { for (auto& pass : this->TestProperties->ErrorRegularExpressions) { - if (pass.first.find(this->ProcessOutput.c_str())) { + if (pass.first.find(this->ProcessOutput)) { reason = "Error regular expression found in output."; reason += " Regex=["; reason += pass.second; @@ -616,10 +616,10 @@ void cmCTestRunTest::DartProcessing() { if (!this->ProcessOutput.empty() && this->ProcessOutput.find("<DartMeasurement") != std::string::npos) { - if (this->TestHandler->DartStuff.find(this->ProcessOutput.c_str())) { + if (this->TestHandler->DartStuff.find(this->ProcessOutput)) { this->TestResult.DartString = this->TestHandler->DartStuff.match(1); // keep searching and replacing until none are left - while (this->TestHandler->DartStuff1.find(this->ProcessOutput.c_str())) { + while (this->TestHandler->DartStuff1.find(this->ProcessOutput)) { // replace the exact match for the string cmSystemTools::ReplaceString( this->ProcessOutput, this->TestHandler->DartStuff1.match(1).c_str(), diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 91b92a3..d1d8d08 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -2310,7 +2310,7 @@ bool cmCTestTestHandler::AddTest(const std::vector<std::string>& args) this->Quiet); if (this->UseExcludeRegExpFlag && this->UseExcludeRegExpFirst && - this->ExcludeTestsRegularExpression.find(testname.c_str())) { + this->ExcludeTestsRegularExpression.find(testname)) { return true; } if (this->MemCheck) { @@ -2365,10 +2365,10 @@ bool cmCTestTestHandler::AddTest(const std::vector<std::string>& args) test.SkipReturnCode = -1; test.PreviousRuns = 0; if (this->UseIncludeRegExpFlag && - !this->IncludeTestsRegularExpression.find(testname.c_str())) { + !this->IncludeTestsRegularExpression.find(testname)) { test.IsInBasedOnREOptions = false; } else if (this->UseExcludeRegExpFlag && !this->UseExcludeRegExpFirst && - this->ExcludeTestsRegularExpression.find(testname.c_str())) { + this->ExcludeTestsRegularExpression.find(testname)) { test.IsInBasedOnREOptions = false; } this->TestList.push_back(test); |