summaryrefslogtreecommitdiff
path: root/Source/CTest
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-01-15 00:06:11 +0100
committerStephen Kelly <steveire@gmail.com>2015-01-18 14:25:24 +0100
commitd92887efabad6a91e221588d0dc7a0bffd91a9f7 (patch)
tree0436e742b7efd6071e01879b90fd71d5890d8b1c /Source/CTest
parentf3e92d281682ee482b1425675b9fccd372cd01f3 (diff)
downloadcmake-d92887efabad6a91e221588d0dc7a0bffd91a9f7.tar.gz
Replace 'foo.size() > 0' pattern with !foo.empty().
Diffstat (limited to 'Source/CTest')
-rw-r--r--Source/CTest/cmCTestBatchTestHandler.cxx2
-rw-r--r--Source/CTest/cmCTestBuildAndTestHandler.cxx4
-rw-r--r--Source/CTest/cmCTestBuildHandler.cxx4
-rw-r--r--Source/CTest/cmCTestCoverageHandler.cxx8
-rw-r--r--Source/CTest/cmCTestRunTest.cxx6
-rw-r--r--Source/CTest/cmCTestSubmitHandler.cxx32
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx2
-rw-r--r--Source/CTest/cmParseDelphiCoverage.cxx4
-rw-r--r--Source/CTest/cmParseJacocoCoverage.cxx2
9 files changed, 32 insertions, 32 deletions
diff --git a/Source/CTest/cmCTestBatchTestHandler.cxx b/Source/CTest/cmCTestBatchTestHandler.cxx
index 7f966aa65d..d62c260d64 100644
--- a/Source/CTest/cmCTestBatchTestHandler.cxx
+++ b/Source/CTest/cmCTestBatchTestHandler.cxx
@@ -58,7 +58,7 @@ void cmCTestBatchTestHandler::WriteSrunArgs(int test, cmsys::ofstream& fout)
fout << "-J=" << properties->Name << " ";
//Write dependency information
- /*if(this->Tests[test].size() > 0)
+ /*if(!this->Tests[test].empty())
{
fout << "-P=afterany";
for(TestSet::iterator i = this->Tests[test].begin();
diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx
index b1fb02dd16..8499846d8a 100644
--- a/Source/CTest/cmCTestBuildAndTestHandler.cxx
+++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx
@@ -82,7 +82,7 @@ int cmCTestBuildAndTestHandler::RunCMake(std::string* outstring,
}
const char* config = 0;
- if ( this->CTest->GetConfigType().size() > 0 )
+ if (!this->CTest->GetConfigType().empty())
{
config = this->CTest->GetConfigType().c_str();
}
@@ -291,7 +291,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
}
std::string output;
const char* config = 0;
- if ( this->CTest->GetConfigType().size() > 0 )
+ if (!this->CTest->GetConfigType().empty())
{
config = this->CTest->GetConfigType().c_str();
}
diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx
index 0c3f206019..5ddc75ff94 100644
--- a/Source/CTest/cmCTestBuildHandler.cxx
+++ b/Source/CTest/cmCTestBuildHandler.cxx
@@ -702,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;
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx
index 6598111ec6..8a1b7249d2 100644
--- a/Source/CTest/cmCTestCoverageHandler.cxx
+++ b/Source/CTest/cmCTestCoverageHandler.cxx
@@ -665,7 +665,7 @@ int cmCTestCoverageHandler::ProcessHandler()
this->EndCoverageLogFile(covLogFile, logFileCount);
- if ( errorsWhileAccumulating.size() > 0 )
+ if (!errorsWhileAccumulating.empty())
{
cmCTestLog(this->CTest, ERROR_MESSAGE, std::endl);
cmCTestLog(this->CTest, ERROR_MESSAGE,
@@ -910,7 +910,7 @@ int cmCTestCoverageHandler::HandleJacocoCoverage(
g.FindFiles(coverageFile);
files=g.GetFiles();
- if (files.size() > 0)
+ if (!files.empty())
{
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"Found Jacoco Files, Performing Coverage" << std::endl);
@@ -943,7 +943,7 @@ int cmCTestCoverageHandler::HandleDelphiCoverage(
g.FindFiles(coverageFile);
files=g.GetFiles();
- if (files.size() > 0)
+ if (!files.empty())
{
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"Found Delphi HTML Files, Performing Coverage" << std::endl);
@@ -973,7 +973,7 @@ int cmCTestCoverageHandler::HandleBlanketJSCoverage(
std::vector<std::string> files;
g.FindFiles(coverageFile);
files=g.GetFiles();
- if (files.size() > 0)
+ if (!files.empty())
{
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"Found BlanketJS output JSON, Performing Coverage" << std::endl);
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx
index 2a3905178f..056554e8ab 100644
--- a/Source/CTest/cmCTestRunTest.cxx
+++ b/Source/CTest/cmCTestRunTest.cxx
@@ -155,7 +155,7 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started)
std::string> >::iterator passIt;
bool forceFail = false;
bool outputTestErrorsToConsole = false;
- if ( this->TestProperties->RequiredRegularExpressions.size() > 0 )
+ if (!this->TestProperties->RequiredRegularExpressions.empty())
{
bool found = false;
for ( passIt = this->TestProperties->RequiredRegularExpressions.begin();
@@ -184,7 +184,7 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started)
}
reason += "]";
}
- if ( this->TestProperties->ErrorRegularExpressions.size() > 0 )
+ if (!this->TestProperties->ErrorRegularExpressions.empty())
{
for ( passIt = this->TestProperties->ErrorRegularExpressions.begin();
passIt != this->TestProperties->ErrorRegularExpressions.end();
@@ -670,7 +670,7 @@ bool cmCTestRunTest::ForkProcess(double testTimeOut, bool explicitTimeout,
cmSystemTools::SaveRestoreEnvironment sre;
#endif
- if (environment && environment->size()>0)
+ if (environment && !environment->empty())
{
cmSystemTools::AppendEnv(*environment);
}
diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx
index fea94ba2b3..07bd413599 100644
--- a/Source/CTest/cmCTestSubmitHandler.cxx
+++ b/Source/CTest/cmCTestSubmitHandler.cxx
@@ -273,13 +273,13 @@ bool cmCTestSubmitHandler::SubmitUsingFTP(const std::string& localprefix,
// Now run off and do what you've been told!
res = ::curl_easy_perform(curl);
- if ( chunk.size() > 0 )
+ if (!chunk.empty())
{
cmCTestLog(this->CTest, DEBUG, "CURL output: ["
<< cmCTestLogWrite(&*chunk.begin(), chunk.size()) << "]"
<< std::endl);
}
- if ( chunkDebug.size() > 0 )
+ if (!chunkDebug.empty())
{
cmCTestLog(this->CTest, DEBUG, "CURL debug output: ["
<< cmCTestLogWrite(&*chunkDebug.begin(), chunkDebug.size()) << "]"
@@ -390,7 +390,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
break;
default:
curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
- if (this->HTTPProxyAuth.size() > 0)
+ if (!this->HTTPProxyAuth.empty())
{
curl_easy_setopt(curl, CURLOPT_PROXYUSERPWD,
this->HTTPProxyAuth.c_str());
@@ -523,14 +523,14 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
chunk.assign(mock_output.begin(), mock_output.end());
}
- if ( chunk.size() > 0 )
+ if (!chunk.empty())
{
cmCTestLog(this->CTest, DEBUG, "CURL output: ["
<< cmCTestLogWrite(&*chunk.begin(), chunk.size()) << "]"
<< std::endl);
this->ParseResponse(chunk);
}
- if ( chunkDebug.size() > 0 )
+ if (!chunkDebug.empty())
{
cmCTestLog(this->CTest, DEBUG, "CURL debug output: ["
<< cmCTestLogWrite(&*chunkDebug.begin(), chunkDebug.size()) << "]"
@@ -576,7 +576,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
res = ::curl_easy_perform(curl);
- if ( chunk.size() > 0 )
+ if (!chunk.empty())
{
cmCTestLog(this->CTest, DEBUG, "CURL output: ["
<< cmCTestLogWrite(&*chunk.begin(), chunk.size()) << "]"
@@ -697,7 +697,7 @@ bool cmCTestSubmitHandler::TriggerUsingHTTP(
break;
default:
curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
- if (this->HTTPProxyAuth.size() > 0)
+ if (!this->HTTPProxyAuth.empty())
{
curl_easy_setopt(curl, CURLOPT_PROXYUSERPWD,
this->HTTPProxyAuth.c_str());
@@ -780,13 +780,13 @@ bool cmCTestSubmitHandler::TriggerUsingHTTP(
return false;
}
- if ( chunk.size() > 0 )
+ if (!chunk.empty())
{
cmCTestLog(this->CTest, DEBUG, "CURL output: ["
<< cmCTestLogWrite(&*chunk.begin(), chunk.size()) << "]"
<< std::endl);
}
- if ( chunkDebug.size() > 0 )
+ if (!chunkDebug.empty())
{
cmCTestLog(this->CTest, DEBUG, "CURL debug output: ["
<< cmCTestLogWrite(&*chunkDebug.begin(), chunkDebug.size())
@@ -1140,12 +1140,12 @@ int cmCTestSubmitHandler::ProcessHandler()
}
}
- if ( this->HTTPProxy.size() > 0 )
+ if (!this->HTTPProxy.empty())
{
cmCTestLog(this->CTest, HANDLER_OUTPUT, " Use HTTP Proxy: "
<< this->HTTPProxy << std::endl);
}
- if ( this->FTPProxy.size() > 0 )
+ if (!this->FTPProxy.empty())
{
cmCTestLog(this->CTest, HANDLER_OUTPUT, " Use FTP Proxy: "
<< this->FTPProxy << std::endl);
@@ -1256,12 +1256,12 @@ int cmCTestSubmitHandler::ProcessHandler()
this->CTest->GetCTestConfiguration("DropSite") +
cmCTest::MakeURLSafe(
this->CTest->GetCTestConfiguration("DropLocation"));
- if ( this->CTest->GetCTestConfiguration("DropSiteUser").size() > 0 )
+ if (!this->CTest->GetCTestConfiguration("DropSiteUser").empty())
{
cmCTestLog(this->CTest, HANDLER_OUTPUT,
this->CTest->GetCTestConfiguration(
"DropSiteUser").c_str());
- if ( this->CTest->GetCTestConfiguration("DropSitePassword").size() > 0 )
+ if (!this->CTest->GetCTestConfiguration("DropSitePassword").empty())
{
cmCTestLog(this->CTest, HANDLER_OUTPUT, ":******");
}
@@ -1310,12 +1310,12 @@ int cmCTestSubmitHandler::ProcessHandler()
cmCTestLog(this->CTest, HANDLER_OUTPUT, " Using HTTP submit method"
<< std::endl
<< " Drop site:" << url);
- if ( this->CTest->GetCTestConfiguration("DropSiteUser").size() > 0 )
+ if (!this->CTest->GetCTestConfiguration("DropSiteUser").empty())
{
url += this->CTest->GetCTestConfiguration("DropSiteUser");
cmCTestLog(this->CTest, HANDLER_OUTPUT,
this->CTest->GetCTestConfiguration("DropSiteUser").c_str());
- if ( this->CTest->GetCTestConfiguration("DropSitePassword").size() > 0 )
+ if (!this->CTest->GetCTestConfiguration("DropSitePassword").empty())
{
url += ":" + this->CTest->GetCTestConfiguration("DropSitePassword");
cmCTestLog(this->CTest, HANDLER_OUTPUT, ":******");
@@ -1400,7 +1400,7 @@ int cmCTestSubmitHandler::ProcessHandler()
{
std::string url;
std::string oldWorkingDirectory;
- if ( this->CTest->GetCTestConfiguration("DropSiteUser").size() > 0 )
+ if (!this->CTest->GetCTestConfiguration("DropSiteUser").empty())
{
url += this->CTest->GetCTestConfiguration("DropSiteUser") + "@";
}
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index cfb0274655..ca8f09f613 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -578,7 +578,7 @@ int cmCTestTestHandler::ProcessHandler()
}
float percent = float(passed.size()) * 100.0f / float(total);
- if ( failed.size() > 0 && percent > 99)
+ if (!failed.empty() && percent > 99)
{
percent = 99;
}
diff --git a/Source/CTest/cmParseDelphiCoverage.cxx b/Source/CTest/cmParseDelphiCoverage.cxx
index 3afbfac788..82194b3373 100644
--- a/Source/CTest/cmParseDelphiCoverage.cxx
+++ b/Source/CTest/cmParseDelphiCoverage.cxx
@@ -61,7 +61,7 @@ public:
continue;
}
else if((line.find("end;") != line.npos)
- && (beginSet.size() > 0))
+ && !beginSet.empty())
{
beginSet.pop_back();
coverageVector.push_back(-1);
@@ -80,7 +80,7 @@ public:
}
}
//Based up what was found, add a line to the coverageVector
- if((beginSet.size() > 0) && line != "" && !blockComFlag
+ if(!beginSet.empty() && line != "" && !blockComFlag
&& !lineComFlag)
{
coverageVector.push_back(0);
diff --git a/Source/CTest/cmParseJacocoCoverage.cxx b/Source/CTest/cmParseJacocoCoverage.cxx
index f270adbbea..780debc1e4 100644
--- a/Source/CTest/cmParseJacocoCoverage.cxx
+++ b/Source/CTest/cmParseJacocoCoverage.cxx
@@ -106,7 +106,7 @@ class cmParseJacocoCoverage::XMLParser: public cmXMLParser
{
FileLinesType& curFileLines=
this->Coverage.TotalCoverage[this->CurFileName];
- if(curFileLines.size() > 0)
+ if(!curFileLines.empty())
{
curFileLines[nr-1] = ci;
}