diff options
Diffstat (limited to 'Source/CTest')
-rw-r--r-- | Source/CTest/cmCTestCoverageHandler.cxx | 16 | ||||
-rw-r--r-- | Source/CTest/cmCTestLaunch.cxx | 8 | ||||
-rw-r--r-- | Source/CTest/cmCTestMemCheckHandler.cxx | 15 | ||||
-rw-r--r-- | Source/CTest/cmCTestSubmitHandler.cxx | 9 | ||||
-rw-r--r-- | Source/CTest/cmCTestTestHandler.cxx | 2 | ||||
-rw-r--r-- | Source/CTest/cmParsePHPCoverage.cxx | 5 |
6 files changed, 12 insertions, 43 deletions
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx index daefb59..ba9e546 100644 --- a/Source/CTest/cmCTestCoverageHandler.cxx +++ b/Source/CTest/cmCTestCoverageHandler.cxx @@ -90,11 +90,8 @@ public: cmsysProcess_Execute(this->Process); this->PipeState = cmsysProcess_GetState(this->Process); // if the process is running or exited return true - if (this->PipeState == cmsysProcess_State_Executing || - this->PipeState == cmsysProcess_State_Exited) { - return true; - } - return false; + return this->PipeState == cmsysProcess_State_Executing || + this->PipeState == cmsysProcess_State_Exited; } void SetStdoutFile(const char* fname) { @@ -705,13 +702,8 @@ bool IsFileInDir(const std::string& infile, const std::string& indir) std::string file = cmSystemTools::CollapseFullPath(infile); std::string dir = cmSystemTools::CollapseFullPath(indir); - if (file.size() > dir.size() && - (fnc(file.substr(0, dir.size())) == fnc(dir)) && - file[dir.size()] == '/') { - return true; - } - - return false; + return file.size() > dir.size() && + fnc(file.substr(0, dir.size())) == fnc(dir) && file[dir.size()] == '/'; } int cmCTestCoverageHandler::HandlePHPCoverage( diff --git a/Source/CTest/cmCTestLaunch.cxx b/Source/CTest/cmCTestLaunch.cxx index 4a408a2..99fa9e7 100644 --- a/Source/CTest/cmCTestLaunch.cxx +++ b/Source/CTest/cmCTestLaunch.cxx @@ -594,12 +594,8 @@ bool cmCTestLaunch::Match(std::string const& line, bool cmCTestLaunch::MatchesFilterPrefix(std::string const& line) const { - if (!this->OptionFilterPrefix.empty() && - cmSystemTools::StringStartsWith(line.c_str(), - this->OptionFilterPrefix.c_str())) { - return true; - } - return false; + return !this->OptionFilterPrefix.empty() && + cmSystemTools::StringStartsWith(line, this->OptionFilterPrefix.c_str()); } int cmCTestLaunch::Main(int argc, const char* const argv[]) diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx index 5ae98af..f8ffd43 100644 --- a/Source/CTest/cmCTestMemCheckHandler.cxx +++ b/Source/CTest/cmCTestMemCheckHandler.cxx @@ -722,10 +722,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckSanitizerOutput( ostr << *i << std::endl; } log = ostr.str(); - if (defects) { - return false; - } - return true; + return defects == 0; } bool cmCTestMemCheckHandler::ProcessMemCheckPurifyOutput( const std::string& str, std::string& log, std::vector<int>& results) @@ -766,10 +763,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckPurifyOutput( } log = ostr.str(); - if (defects) { - return false; - } - return true; + return defects == 0; } bool cmCTestMemCheckHandler::ProcessMemCheckValgrindOutput( @@ -904,10 +898,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckValgrindOutput( << (cmSystemTools::GetTime() - sttime) << std::endl, this->Quiet); log = ostr.str(); - if (defects) { - return false; - } - return true; + return defects == 0; } bool cmCTestMemCheckHandler::ProcessMemCheckBoundsCheckerOutput( diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index f373348..32975df 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -845,10 +845,7 @@ bool cmCTestSubmitHandler::SubmitUsingSCP(const std::string& scp_command, } } cmsysProcess_Delete(cp); - if (problems) { - return false; - } - return true; + return problems == 0; } bool cmCTestSubmitHandler::SubmitUsingCP(const std::string& localprefix, @@ -870,7 +867,6 @@ bool cmCTestSubmitHandler::SubmitUsingCP(const std::string& localprefix, } cmCTest::SetOfStrings::const_iterator file; - bool problems = false; for (file = files.begin(); file != files.end(); ++file) { std::string lfname = localprefix; cmSystemTools::ConvertToUnixSlashes(lfname); @@ -883,9 +879,6 @@ bool cmCTestSubmitHandler::SubmitUsingCP(const std::string& localprefix, } std::string tagDoneFile = destination + "/" + remoteprefix + "DONE"; cmSystemTools::Touch(tagDoneFile, true); - if (problems) { - return false; - } return true; } diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 20ef693..55a6518 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -1406,7 +1406,7 @@ void cmCTestTestHandler::UseIncludeRegExp() void cmCTestTestHandler::UseExcludeRegExp() { this->UseExcludeRegExpFlag = true; - this->UseExcludeRegExpFirst = this->UseIncludeRegExpFlag ? false : true; + this->UseExcludeRegExpFirst = !this->UseIncludeRegExpFlag; } const char* cmCTestTestHandler::GetTestStatus(int status) diff --git a/Source/CTest/cmParsePHPCoverage.cxx b/Source/CTest/cmParsePHPCoverage.cxx index eb0d962..5ec2718 100644 --- a/Source/CTest/cmParsePHPCoverage.cxx +++ b/Source/CTest/cmParsePHPCoverage.cxx @@ -27,10 +27,7 @@ bool cmParsePHPCoverage::ReadUntil(std::istream& in, char until) char c = 0; while (in.get(c) && c != until) { } - if (c != until) { - return false; - } - return true; + return c == until; } bool cmParsePHPCoverage::ReadCoverageArray(std::istream& in, std::string const& fileName) |