Skip to content

Commit

Permalink
Merge pull request #38 from mPokornyETM/format-ctrl-code
Browse files Browse the repository at this point in the history
Format ctrl code
  • Loading branch information
dhoegerlETM authored May 18, 2023
2 parents 4e4d119 + 8b7fab4 commit 4325c02
Show file tree
Hide file tree
Showing 53 changed files with 1,719 additions and 1,571 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
WinCCOA_QualityChecks/bin/ctrlppcheck/
ctrlppcheck/build/
# astyle backup files
*.ctl.orig
2 changes: 1 addition & 1 deletion WinCCOA_QualityChecks/scripts/QgTemplate.ctl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class QgTemplate : QgBase

public int setUp()
{
if ( QgBase::setUp() )
if (QgBase::setUp())
return -1;

// _sourceDir.create();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@


//--------------------------------------------------------------------------------
/**
/**
@breif main rutine to start QualityGate QgStaticCheck-OASyntaxCheck
*/
void main()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@ class QgStaticCheck_OverloadedFiles : QgBase
//--------------------------------------------------------------------------------
//@public members
//--------------------------------------------------------------------------------

//------------------------------------------------------------------------------
public int setUp()
{
if ( QgBase::setUp() )
if (QgBase::setUp())
return -1;

QgVersionResult::showErrorsOnly = TRUE;
return 0;
}

//------------------------------------------------------------------------------
/** @brief Calculates pictures directory.
@details Calculates pictures directory recursive.
Expand All @@ -45,7 +45,7 @@ class QgStaticCheck_OverloadedFiles : QgBase
{
return _files.calculate();
}

//------------------------------------------------------------------------------
/** @brief Function validates calculated pictures dircetory.
@warning Call function calculate() before. Otherwise validation does not work.
Expand All @@ -70,12 +70,12 @@ class QgStaticCheck_OverloadedFiles : QgBase
//--------------------------------------------------------------------------------
//@private members
//--------------------------------------------------------------------------------

QgOverloadedFilesCheck _files = QgOverloadedFilesCheck(); //!< Pictures directory
};

//--------------------------------------------------------------------------------
/**
/**
@breif main rutine to start QualityGate QgStaticCheck-Pictures
*/
void main()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,25 @@ class QgStaticPanelCheck : QgBase
//@public members
//--------------------------------------------------------------------------------
public string checkedPath = PROJ_PATH;

//------------------------------------------------------------------------------
/** @brief Function setups panels tests.
@details Creates temp-source dir.
@return 0 when successfull, otherwise -1.
*/
public int setUp()
{
if ( QgBase::setUp() )
if (QgBase::setUp())
return -1;


PanelCheck::setSourceDirPath(this.checkedPath);
PanelFile::setSourceDirPath(this.checkedPath);
_panels.setDir(this.checkedPath + PANELS_REL_PATH);
if ( !_panels.exists() )

if (!_panels.exists())
setMinValidScore("QgStaticCheck_Panels", "assert.missingPanels", "reason.missingPanels");

return 0;
}

Expand All @@ -56,12 +56,12 @@ class QgStaticPanelCheck : QgBase
*/
public int calculate()
{
if ( _panels.exists() )
if (_panels.exists())
return _panels.calculate();
else
return 0;
}

//------------------------------------------------------------------------------
/** @brief Function validates calculated panels dircetory.
@warning Call function calculate() before. Otherwise validation does not work.
Expand All @@ -86,12 +86,12 @@ class QgStaticPanelCheck : QgBase
//--------------------------------------------------------------------------------
//@private members
//--------------------------------------------------------------------------------

PanelsDir _panels = PanelsDir(); //!< panels directory
};

//--------------------------------------------------------------------------------
/**
/**
@breif main rutine to start QualityGate QgStaticCheck-panels
*/
void main(string path = PROJ_PATH)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,23 @@ class QgStaticCheck_Pictures : QgBase
//@public members
//--------------------------------------------------------------------------------
public string checkedPath = PROJ_PATH + PICTURES_REL_PATH;

//------------------------------------------------------------------------------
/** @brief Function setups pictures tests.
@details Creates temp-source dir.
@return 0 when successfull, otherwise -1.
*/
public int setUp()
{
if ( QgBase::setUp() )
if (QgBase::setUp())
return -1;

throwError(makeError("", PRIO_INFO, ERR_CONTROL, 0, Qg::getId() + " will check " + this.checkedPath + PICTURES_REL_PATH));
_pictures.setDir(this.checkedPath);
if ( !_pictures.exists() )

if (!_pictures.exists())
setMinValidScore("QgStaticCheck_Pictures", "assert.missingPictures", "reason.missingPictures");

return 0;
}

Expand All @@ -55,12 +55,12 @@ class QgStaticCheck_Pictures : QgBase
*/
public int calculate()
{
if ( _pictures.exists() )
if (_pictures.exists())
return _pictures.calculate();

return 0;
}

//------------------------------------------------------------------------------
/** @brief Function validates calculated pictures dircetory.
@warning Call function calculate() before. Otherwise validation does not work.
Expand All @@ -85,12 +85,12 @@ class QgStaticCheck_Pictures : QgBase
//--------------------------------------------------------------------------------
//@private members
//--------------------------------------------------------------------------------

PicturesDir _pictures = PicturesDir(); //!< Pictures directory
};

//--------------------------------------------------------------------------------
/**
/**
@breif main rutine to start QualityGate QgStaticCheck-Pictures
*/
void main(string path = PROJ_PATH + PICTURES_REL_PATH)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,32 +32,34 @@ class QgStaticCheck_Scripts : QgBase
//---------------------------------------------------------------------------
public int setUp()
{
if ( QgBase::setUp() )
if (QgBase::setUp())
{
throwError(makeError("", PRIO_SEVERE, ERR_CONTROL, 0, "QgBase::setUp fails"));
return -1;
}

if ( Qg::getId() == "QgStaticCheck_Scripts" )
if (Qg::getId() == "QgStaticCheck_Scripts")
{
if (this.checkedPath.isEmpty())
{
this.checkedPath = PROJ_PATH + SCRIPTS_REL_PATH;
}

_scriptsData.setDir(this.checkedPath);
_scriptsData.setType(ScriptsDataType::scripts);
}
else if ( Qg::getId() == "QgStaticCheck_Libs" )
else if (Qg::getId() == "QgStaticCheck_Libs")
{
if (this.checkedPath.isEmpty())
{
this.checkedPath = PROJ_PATH + LIBS_REL_PATH;
}

_scriptsData.setDir(this.checkedPath);
_scriptsData.setType(ScriptsDataType::libs);
}

if ( !_scriptsData.exists() )
if (!_scriptsData.exists())
setMinValidScore(Qg::getId(), "assert.missingScripts", "reason.missingScripts");

return 0;
Expand All @@ -66,7 +68,7 @@ class QgStaticCheck_Scripts : QgBase
//---------------------------------------------------------------------------
public int calculate()
{
if ( _scriptsData.exists() )
if (_scriptsData.exists())
return _scriptsData.calculate();
else
return 0;
Expand All @@ -75,8 +77,8 @@ class QgStaticCheck_Scripts : QgBase
//---------------------------------------------------------------------------
public int validate()
{
if ( (Qg::getId() == "QgStaticCheck_Scripts") && (_scriptsData.getCountOfFilesRecursive() <= 0) &&
isdir(this.checkedPath + LIBS_REL_PATH) && (_scriptsData.getCountOfSubDirs() <= 0) )
if ((Qg::getId() == "QgStaticCheck_Scripts") && (_scriptsData.getCountOfFilesRecursive() <= 0) &&
isdir(this.checkedPath + LIBS_REL_PATH) && (_scriptsData.getCountOfSubDirs() <= 0))
{
// there are no scripts. Libs only and libs are checked in QgStaticCheck_Libs
setMinValidScore("QgStaticCheck_Scripts", "assert.missingScripts", "reason.missingScripts");
Expand Down Expand Up @@ -111,11 +113,11 @@ class QgStaticCheck_Scripts : QgBase
*/
void main(string testType, string path = "")
{
if ( testType == "scripts" )
if (testType == "scripts")
{
Qg::setId("QgStaticCheck_Scripts");
}
else if ( testType == "libs" )
else if (testType == "libs")
{
Qg::setId("QgStaticCheck_Libs");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class OaLogger
{
err = makeError(msgCatalog, prio, ERR_CONTROL, 0, codeOrError);
}
if (isA(codeOrError, ERRCLASS_VAR) || isA(codeOrError, DYN_ERRCLASS_VAR))
else if (isA(codeOrError, ERRCLASS_VAR) || isA(codeOrError, DYN_ERRCLASS_VAR))
{
err = codeOrError;
}
Expand Down
Loading

0 comments on commit 4325c02

Please sign in to comment.