cmCTest*Handler: Use default member initialization

This commit is contained in:
Daniel Pfeifer
2024-10-24 23:30:46 +02:00
parent d07a35a336
commit 9fe40b33e0
12 changed files with 32 additions and 75 deletions

View File

@@ -178,27 +178,8 @@ static cmCTestBuildCompileErrorWarningRex cmCTestWarningErrorFileLine[] = {
cmCTestBuildHandler::cmCTestBuildHandler(cmCTest* ctest)
: Superclass(ctest)
, LastErrorOrWarning(this->ErrorsAndWarnings.end())
{
this->MaxPreContext = 10;
this->MaxPostContext = 10;
this->MaxErrors = 50;
this->MaxWarnings = 50;
this->LastErrorOrWarning = this->ErrorsAndWarnings.end();
this->UseCTestLaunch = false;
this->BuildOutputLogSize = 0;
this->OutputLineCounter = 0;
this->PostContextCount = 0;
this->TotalErrors = 0;
this->TotalWarnings = 0;
this->LastTickChar = 0;
this->ErrorQuotaReached = false;
this->WarningQuotaReached = false;
}
void cmCTestBuildHandler::PopulateCustomVectors(cmMakefile* mf)

View File

@@ -116,34 +116,34 @@ private:
t_BuildProcessingQueueType BuildProcessingQueue;
t_BuildProcessingQueueType BuildProcessingErrorQueue;
size_t BuildOutputLogSize;
size_t BuildOutputLogSize = 0;
std::vector<char> CurrentProcessingLine;
std::string SimplifySourceDir;
std::string SimplifyBuildDir;
size_t OutputLineCounter;
size_t OutputLineCounter = 0;
using t_ErrorsAndWarningsVector = std::vector<cmCTestBuildErrorWarning>;
t_ErrorsAndWarningsVector ErrorsAndWarnings;
t_ErrorsAndWarningsVector::iterator LastErrorOrWarning;
size_t PostContextCount;
size_t MaxPreContext;
size_t MaxPostContext;
size_t PostContextCount = 0;
size_t MaxPreContext = 10;
size_t MaxPostContext = 10;
std::deque<std::string> PreContext;
int TotalErrors;
int TotalWarnings;
char LastTickChar;
int TotalErrors = 0;
int TotalWarnings = 0;
char LastTickChar = '\0';
bool ErrorQuotaReached;
bool WarningQuotaReached;
bool ErrorQuotaReached = false;
bool WarningQuotaReached = false;
int MaxErrors;
int MaxWarnings;
int MaxErrors = 50;
int MaxWarnings = 50;
// Used to remove ANSI color codes before checking for errors and warnings.
cmStringReplaceHelper* ColorRemover;
bool UseCTestLaunch;
bool UseCTestLaunch = false;
std::string CTestLaunchDir;
class LaunchHelper;

View File

@@ -11,12 +11,6 @@
cmCTestGenericHandler::cmCTestGenericHandler(cmCTest* ctest)
: CTest(ctest)
{
this->HandlerVerbose = cmSystemTools::OUTPUT_NONE;
this->SubmitIndex = 0;
this->AppendXML = false;
this->Quiet = false;
this->TestLoad = 0;
this->SetVerbose(ctest->GetExtraVerbose());
this->SetSubmitIndex(ctest->GetSubmitIndex());
}

View File

@@ -70,13 +70,13 @@ protected:
cmGeneratedFileStream& xofs);
bool StartLogFile(const char* name, cmGeneratedFileStream& xofs);
bool AppendXML;
bool Quiet;
unsigned long TestLoad;
cmSystemTools::OutputOption HandlerVerbose;
bool AppendXML = false;
bool Quiet = false;
unsigned long TestLoad = 0;
cmSystemTools::OutputOption HandlerVerbose = cmSystemTools::OUTPUT_NONE;
cmCTest* CTest;
t_StringToString LogFileNames;
cmake* CMake = nullptr;
int SubmitIndex;
int SubmitIndex = 0;
};

View File

@@ -124,9 +124,6 @@ cmCTestMemCheckHandler::cmCTestMemCheckHandler(cmCTest* ctest)
this->MemCheck = true;
this->TestOptions.OutputSizePassed = 0;
this->TestOptions.OutputSizeFailed = 0;
this->LogWithPID = false;
this->MemoryTesterStyle = UNKNOWN;
this->DefectCount = 0;
}
int cmCTestMemCheckHandler::PreProcessHandler()

View File

@@ -99,15 +99,15 @@ private:
std::string MemoryTester;
std::vector<std::string> MemoryTesterDynamicOptions;
std::vector<std::string> MemoryTesterOptions;
int MemoryTesterStyle;
int MemoryTesterStyle = UNKNOWN;
std::string MemoryTesterOutputFile;
std::string MemoryTesterEnvironmentVariable;
// these are used to store the types of errors that can show up
std::vector<std::string> ResultStrings;
std::vector<std::string> ResultStringsLong;
std::vector<int> GlobalResults;
bool LogWithPID; // does log file add pid
int DefectCount;
bool LogWithPID = false; // does log file add pid
int DefectCount = 0;
std::vector<int>::size_type FindOrAddWarning(const std::string& warning);
// initialize the ResultStrings and ResultStringsLong for

View File

@@ -125,10 +125,6 @@ cmCTestSubmitHandler::cmCTestSubmitHandler(cmCTest* ctest)
p = static_cast<cmCTest::Part>(p + 1)) {
this->SubmitPart[p] = true;
}
this->HasWarnings = false;
this->HasErrors = false;
this->HTTPProxyType = 0;
this->LogFile = nullptr;
}
bool cmCTestSubmitHandler::SubmitUsingHTTP(

View File

@@ -66,12 +66,12 @@ private:
class ResponseParser;
std::string HTTPProxy;
int HTTPProxyType;
int HTTPProxyType = 0;
std::string HTTPProxyAuth;
std::ostream* LogFile;
std::ostream* LogFile = nullptr;
bool SubmitPart[cmCTest::PartCount];
bool HasWarnings;
bool HasErrors;
bool HasWarnings = false;
bool HasErrors = false;
std::set<std::string> Files;
std::vector<std::string> HttpHeaders;

View File

@@ -278,14 +278,6 @@ cmCTestTestHandler::cmCTestTestHandler(cmCTest* ctest)
: Superclass(ctest)
, TestOptions(ctest->GetTestOptions())
{
this->UseIncludeRegExpFlag = false;
this->UseExcludeRegExpFlag = false;
this->UseExcludeRegExpFirst = false;
this->MemCheck = false;
this->LogFile = nullptr;
// Regular expressions to scan test output for custom measurements.
// Capture the whole section of test output from the first opening
@@ -304,8 +296,6 @@ cmCTestTestHandler::cmCTestTestHandler(cmCTest* ctest)
// Capture content from <CTestLabel>...</CTestLabel>
this->CustomLabelRegex.compile("<CTestLabel>(.*)</CTestLabel>");
this->ElapsedTestingTime = cmDuration();
}
void cmCTestTestHandler::PopulateCustomVectors(cmMakefile* mf)

View File

@@ -271,7 +271,7 @@ protected:
std::string EndTest;
std::chrono::system_clock::time_point StartTestTime;
std::chrono::system_clock::time_point EndTestTime;
bool MemCheck;
bool MemCheck = false;
int MaxIndex;
public:
@@ -348,9 +348,9 @@ private:
std::vector<int> TestsToRun;
bool UseIncludeRegExpFlag;
bool UseExcludeRegExpFlag;
bool UseExcludeRegExpFirst;
bool UseIncludeRegExpFlag = false;
bool UseExcludeRegExpFlag = false;
bool UseExcludeRegExpFirst = false;
std::vector<cmsys::RegularExpression> IncludeLabelRegularExpressions;
std::vector<cmsys::RegularExpression> ExcludeLabelRegularExpressions;
cmsys::RegularExpression IncludeTestsRegularExpression;
@@ -373,7 +373,7 @@ private:
cmsys::RegularExpression CustomCompletionStatusRegex;
cmsys::RegularExpression CustomLabelRegex;
std::ostream* LogFile;
std::ostream* LogFile = nullptr;
cmCTest::Repeat RepeatMode = cmCTest::Repeat::Never;
int RepeatCount = 1;

View File

@@ -38,7 +38,6 @@ static const char* cmCTestUpdateHandlerUpdateToString(int type)
cmCTestUpdateHandler::cmCTestUpdateHandler(cmCTest* ctest)
: Superclass(ctest)
{
this->UpdateType = e_CVS;
}
int cmCTestUpdateHandler::DetermineType(const char* cmd, const char* type)

View File

@@ -55,7 +55,7 @@ private:
// The VCS command to update the working tree.
std::string UpdateCommand;
std::string SourceDirectory;
int UpdateType;
int UpdateType = e_CVS;
int DetectVCS(const std::string& dir);
bool SelectVCS();