diff options
Diffstat (limited to 'Source/CTest/cmCTestBuildHandler.cxx')
-rw-r--r-- | Source/CTest/cmCTestBuildHandler.cxx | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx index 2ec1365..8f087ab 100644 --- a/Source/CTest/cmCTestBuildHandler.cxx +++ b/Source/CTest/cmCTestBuildHandler.cxx @@ -36,9 +36,6 @@ #include <math.h> #include <float.h> -#if defined(__BORLANDC__) -# pragma warn -8060 /* possibly incorrect assignment */ -#endif static const char* cmCTestErrorMatches[] = { "^[Bb]us [Ee]rror", @@ -347,7 +344,7 @@ int cmCTestBuildHandler::ProcessHandler() // Determine build command and build directory std::string makeCommand = this->GetMakeCommand(); - if ( makeCommand.size() == 0 ) + if (makeCommand.empty()) { cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot find MakeCommand key in the DartConfiguration.tcl" @@ -357,7 +354,7 @@ int cmCTestBuildHandler::ProcessHandler() const std::string &buildDirectory = this->CTest->GetCTestConfiguration("BuildDirectory"); - if ( buildDirectory.size() == 0 ) + if (buildDirectory.empty()) { cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot find BuildDirectory key in the DartConfiguration.tcl" @@ -610,7 +607,7 @@ void cmCTestBuildHandler::GenerateXMLLaunched(std::ostream& os) int numWarningsAllowed = this->MaxWarnings; // Identify fragments on disk. cmsys::Directory launchDir; - launchDir.Load(this->CTestLaunchDir.c_str()); + launchDir.Load(this->CTestLaunchDir); unsigned long n = launchDir.GetNumberOfFiles(); for(unsigned long i=0; i < n; ++i) { @@ -649,7 +646,7 @@ void cmCTestBuildHandler::GenerateXMLLogScraped(std::ostream& os) std::string srcdir = this->CTest->GetCTestConfiguration("SourceDirectory"); // make sure the source dir is in the correct case on windows // via a call to collapse full path. - srcdir = cmSystemTools::CollapseFullPath(srcdir.c_str()); + srcdir = cmSystemTools::CollapseFullPath(srcdir); srcdir += "/"; for ( it = ew.begin(); it != ew.end() && (numErrorsAllowed || numWarningsAllowed); it++ ) @@ -695,7 +692,7 @@ void cmCTestBuildHandler::GenerateXMLLogScraped(std::ostream& os) { // make sure it is a full path with the correct case cm->SourceFile = cmSystemTools::CollapseFullPath( - cm->SourceFile.c_str()); + cm->SourceFile); cmSystemTools::ReplaceString( cm->SourceFile, srcdir.c_str(), ""); } @@ -705,12 +702,12 @@ void cmCTestBuildHandler::GenerateXMLLogScraped(std::ostream& os) } if ( !cm->SourceFile.empty() && cm->LineNumber >= 0 ) { - if ( cm->SourceFile.size() > 0 ) + if (!cm->SourceFile.empty()) { os << "\t\t<SourceFile>" << cm->SourceFile << "</SourceFile>" << std::endl; } - if ( cm->SourceFileTail.size() > 0 ) + if (!cm->SourceFileTail.empty()) { os << "\t\t<SourceFileTail>" << cm->SourceFileTail << "</SourceFileTail>" << std::endl; @@ -822,7 +819,7 @@ cmCTestBuildHandler::LaunchHelper::LaunchHelper(cmCTestBuildHandler* handler): launchDir += "/Build"; // Clean out any existing launcher fragments. - cmSystemTools::RemoveADirectory(launchDir.c_str()); + cmSystemTools::RemoveADirectory(launchDir); if(this->Handler->UseCTestLaunch) { @@ -831,7 +828,7 @@ cmCTestBuildHandler::LaunchHelper::LaunchHelper(cmCTestBuildHandler* handler): this->WriteLauncherConfig(); std::string launchEnv = "CTEST_LAUNCH_LOGS="; launchEnv += launchDir; - cmSystemTools::PutEnv(launchEnv.c_str()); + cmSystemTools::PutEnv(launchEnv); } } @@ -1097,11 +1094,8 @@ void cmCTestBuildHandler::ProcessBuffer(const char* data, int length, { // Create a contiguous array for the line this->CurrentProcessingLine.clear(); - t_BuildProcessingQueueType::iterator cit; - for ( cit = queue->begin(); cit != it; ++cit ) - { - this->CurrentProcessingLine.push_back(*cit); - } + this->CurrentProcessingLine.insert(this->CurrentProcessingLine.end(), + queue->begin(), it); this->CurrentProcessingLine.push_back(0); const char* line = &*this->CurrentProcessingLine.begin(); @@ -1156,7 +1150,7 @@ void cmCTestBuildHandler::ProcessBuffer(const char* data, int length, { // This is not an error or warning. // So, figure out if this is a post-context line - if ( this->ErrorsAndWarnings.size() && + if ( !this->ErrorsAndWarnings.empty() && this->LastErrorOrWarning != this->ErrorsAndWarnings.end() && this->PostContextCount < this->MaxPostContext ) { |