summaryrefslogtreecommitdiffstats
path: root/Source/cmCTest.cxx
diff options
context:
space:
mode:
authorDaniel Pfeifer <daniel@pfeifer-mail.de>2017-08-22 21:42:36 (GMT)
committerDaniel Pfeifer <daniel@pfeifer-mail.de>2017-08-24 21:39:47 (GMT)
commit5962db438939ef2754509b8578af1f845ec07dc8 (patch)
treef6b0c0db2acc8dc889d2d5d46fdf75659daa17e7 /Source/cmCTest.cxx
parentfe19fda2aa2595622c463fccaa8b36a91e4521c4 (diff)
downloadCMake-5962db438939ef2754509b8578af1f845ec07dc8.zip
CMake-5962db438939ef2754509b8578af1f845ec07dc8.tar.gz
CMake-5962db438939ef2754509b8578af1f845ec07dc8.tar.bz2
Use C++11 nullptr
Diffstat (limited to 'Source/cmCTest.cxx')
-rw-r--r--Source/cmCTest.cxx50
1 files changed, 25 insertions, 25 deletions
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index dfb1398..f948645 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -67,7 +67,7 @@
struct tm* cmCTest::GetNightlyTime(std::string const& str, bool tomorrowtag)
{
struct tm* lctime;
- time_t tctime = time(CM_NULLPTR);
+ time_t tctime = time(nullptr);
lctime = gmtime(&tctime);
char buf[1024];
// add todays year day and month to the time in str because
@@ -85,7 +85,7 @@ struct tm* cmCTest::GetNightlyTime(std::string const& str, bool tomorrowtag)
// As such, this time may be in the past or in the future.
time_t ntime = curl_getdate(buf, &tctime);
cmCTestLog(this, DEBUG, " Get curl time: " << ntime << std::endl);
- tctime = time(CM_NULLPTR);
+ tctime = time(nullptr);
cmCTestLog(this, DEBUG, " Get the current time: " << tctime << std::endl);
const int dayLength = 24 * 60 * 60;
@@ -131,7 +131,7 @@ std::string cmCTest::CleanString(const std::string& str)
std::string cmCTest::CurrentTime()
{
- time_t currenttime = time(CM_NULLPTR);
+ time_t currenttime = time(nullptr);
struct tm* t = localtime(&currenttime);
// return ::CleanString(ctime(&currenttime));
char current_time[1024];
@@ -242,7 +242,7 @@ std::string cmCTest::DecodeURL(const std::string& in)
for (const char* c = in.c_str(); *c; ++c) {
if (*c == '%' && isxdigit(*(c + 1)) && isxdigit(*(c + 2))) {
char buf[3] = { *(c + 1), *(c + 2), 0 };
- out.append(1, char(strtoul(buf, CM_NULLPTR, 16)));
+ out.append(1, char(strtoul(buf, nullptr, 16)));
c += 2;
} else {
out.append(1, *c);
@@ -286,7 +286,7 @@ cmCTest::cmCTest()
this->ScheduleType = "";
this->StopTime = "";
this->NextDayStopTime = false;
- this->OutputLogFile = CM_NULLPTR;
+ this->OutputLogFile = nullptr;
this->OutputLogFileLastTag = -1;
this->SuppressUpdatingCTestConfiguration = false;
this->DartVersion = 1;
@@ -344,7 +344,7 @@ cmCTest::cmCTest()
cmCTest::~cmCTest()
{
cmDeleteAll(this->TestingHandlers);
- this->SetOutputLogFileName(CM_NULLPTR);
+ this->SetOutputLogFileName(nullptr);
}
void cmCTest::SetParallelLevel(int level)
@@ -465,7 +465,7 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command)
std::string tag;
if (createNewTag) {
- time_t tctime = time(CM_NULLPTR);
+ time_t tctime = time(nullptr);
if (this->TomorrowTag) {
tctime += (24 * 60 * 60);
}
@@ -490,7 +490,7 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command)
}
tfin.close();
}
- if (tag.empty() || (CM_NULLPTR != command) || this->Parts[PartStart]) {
+ if (tag.empty() || (nullptr != command) || this->Parts[PartStart]) {
cmCTestOptionalLog(
this, DEBUG,
"TestModel: " << this->GetTestModelString() << std::endl, quiet);
@@ -512,7 +512,7 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command)
ofs << this->GetTestModelString() << std::endl;
}
ofs.close();
- if (CM_NULLPTR == command) {
+ if (nullptr == command) {
cmCTestOptionalLog(this, OUTPUT, "Create new tag: "
<< tag << " - " << this->GetTestModelString()
<< std::endl,
@@ -808,7 +808,7 @@ cmCTestGenericHandler* cmCTest::GetInitializedHandler(const char* handler)
cmCTest::t_TestingHandlers::iterator it =
this->TestingHandlers.find(handler);
if (it == this->TestingHandlers.end()) {
- return CM_NULLPTR;
+ return nullptr;
}
it->second->Initialize();
return it->second;
@@ -819,7 +819,7 @@ cmCTestGenericHandler* cmCTest::GetHandler(const char* handler)
cmCTest::t_TestingHandlers::iterator it =
this->TestingHandlers.find(handler);
if (it == this->TestingHandlers.end()) {
- return CM_NULLPTR;
+ return nullptr;
}
return it->second;
}
@@ -977,7 +977,7 @@ int cmCTest::RunMakeCommand(const char* command, std::string& output,
a != args.end(); ++a) {
argv.push_back(a->c_str());
}
- argv.push_back(CM_NULLPTR);
+ argv.push_back(nullptr);
output = "";
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, "Run command:");
@@ -1007,7 +1007,7 @@ int cmCTest::RunMakeCommand(const char* command, std::string& output,
cmCTestLog(this, HANDLER_PROGRESS_OUTPUT, " Each . represents "
<< tick_len << " bytes of output" << std::endl
<< " " << std::flush);
- while (cmsysProcess_WaitForData(cp, &data, &length, CM_NULLPTR)) {
+ while (cmsysProcess_WaitForData(cp, &data, &length, nullptr)) {
processOutput.DecodeText(data, length, strdata);
for (size_t cc = 0; cc < strdata.size(); ++cc) {
if (strdata[cc] == 0) {
@@ -1043,7 +1043,7 @@ int cmCTest::RunMakeCommand(const char* command, std::string& output,
cmCTestLog(this, HANDLER_PROGRESS_OUTPUT, " Size of output: "
<< int(double(output.size()) / 1024.0) << "K" << std::endl);
- cmsysProcess_WaitForExit(cp, CM_NULLPTR);
+ cmsysProcess_WaitForExit(cp, nullptr);
int result = cmsysProcess_GetState(cp);
@@ -1172,7 +1172,7 @@ int cmCTest::RunTest(std::vector<const char*> argv, std::string* output,
int length;
cmProcessOutput processOutput(encoding);
std::string strdata;
- while (cmsysProcess_WaitForData(cp, &data, &length, CM_NULLPTR)) {
+ while (cmsysProcess_WaitForData(cp, &data, &length, nullptr)) {
processOutput.DecodeText(data, length, strdata);
if (output) {
tempOutput.insert(tempOutput.end(), data, data + length);
@@ -1192,7 +1192,7 @@ int cmCTest::RunTest(std::vector<const char*> argv, std::string* output,
}
}
- cmsysProcess_WaitForExit(cp, CM_NULLPTR);
+ cmsysProcess_WaitForExit(cp, nullptr);
processOutput.DecodeText(tempOutput, tempOutput);
if (output && tempOutput.begin() != tempOutput.end()) {
output->append(&*tempOutput.begin(), tempOutput.size());
@@ -2229,7 +2229,7 @@ int cmCTest::ExecuteTests()
it->second->SetSubmitIndex(this->SubmitIndex);
}
std::string cwd = cmSystemTools::GetCurrentWorkingDirectory();
- if (!this->Initialize(cwd.c_str(), CM_NULLPTR)) {
+ if (!this->Initialize(cwd.c_str(), nullptr)) {
res = 12;
cmCTestLog(this, ERROR_MESSAGE, "Problem initializing the dashboard."
<< std::endl);
@@ -2387,7 +2387,7 @@ std::string cmCTest::GetShortPathToFile(const char* cfname)
bool inBld = bldRelpath.find("..") == std::string::npos;
// TODO: Handle files with .. in their name
- std::string* res = CM_NULLPTR;
+ std::string* res = nullptr;
if (inSrc && inBld) {
// If both have relative path with no dots, pick the shorter one
@@ -2437,7 +2437,7 @@ void cmCTest::EmptyCTestConfiguration()
void cmCTest::DetermineNextDayStop()
{
struct tm* lctime;
- time_t current_time = time(CM_NULLPTR);
+ time_t current_time = time(nullptr);
lctime = gmtime(&current_time);
int gm_hour = lctime->tm_hour;
time_t gm_time = mktime(lctime);
@@ -2521,7 +2521,7 @@ bool cmCTest::GetProduceXML()
const char* cmCTest::GetSpecificTrack()
{
if (this->SpecificTrack.empty()) {
- return CM_NULLPTR;
+ return nullptr;
}
return this->SpecificTrack.c_str();
}
@@ -2596,7 +2596,7 @@ bool cmCTest::RunCommand(const char* command, std::string* stdOut,
a != args.end(); ++a) {
argv.push_back(a->c_str());
}
- argv.push_back(CM_NULLPTR);
+ argv.push_back(nullptr);
*stdOut = "";
*stdErr = "";
@@ -2619,7 +2619,7 @@ bool cmCTest::RunCommand(const char* command, std::string* stdOut,
int res;
bool done = false;
while (!done) {
- res = cmsysProcess_WaitForData(cp, &data, &length, CM_NULLPTR);
+ res = cmsysProcess_WaitForData(cp, &data, &length, nullptr);
switch (res) {
case cmsysProcess_Pipe_STDOUT:
tempOutput.insert(tempOutput.end(), data, data + length);
@@ -2643,7 +2643,7 @@ bool cmCTest::RunCommand(const char* command, std::string* stdOut,
}
}
- cmsysProcess_WaitForExit(cp, CM_NULLPTR);
+ cmsysProcess_WaitForExit(cp, nullptr);
if (!tempOutput.empty()) {
processOutput.DecodeText(tempOutput, tempOutput);
stdOut->append(&*tempOutput.begin(), tempOutput.size());
@@ -2687,7 +2687,7 @@ void cmCTest::SetOutputLogFileName(const char* name)
{
if (this->OutputLogFile) {
delete this->OutputLogFile;
- this->OutputLogFile = CM_NULLPTR;
+ this->OutputLogFile = nullptr;
}
if (name) {
this->OutputLogFile = new cmGeneratedFileStream(name);
@@ -2701,7 +2701,7 @@ static const char* cmCTestStringLogType[] = { "DEBUG",
"HANDLER_VERBOSE_OUTPUT",
"WARNING",
"ERROR_MESSAGE",
- CM_NULLPTR };
+ nullptr };
#define cmCTestLogOutputFileLine(stream) \
if (this->ShowLineNumbers) { \