diff options
author | Vitaly Stakhovsky <vvs31415@gitlab.org> | 2018-08-07 15:27:20 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-08-07 19:28:24 (GMT) |
commit | 69ca85cc7faf937d6d9d1dc1a27e062cd7765b1f (patch) | |
tree | f323fcadf3c4e11227a0eea006ae7bfa17e8d26c /Source/CTest | |
parent | d7a52f8c24a29ff7f64b00566b646f2d125d4ac0 (diff) | |
download | CMake-69ca85cc7faf937d6d9d1dc1a27e062cd7765b1f.zip CMake-69ca85cc7faf937d6d9d1dc1a27e062cd7765b1f.tar.gz CMake-69ca85cc7faf937d6d9d1dc1a27e062cd7765b1f.tar.bz2 |
Remove unnecessary c_str() in RegularExpression::find calls
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 8527d54..74af85c 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 0bffde3..bbe0ad3 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); |