aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--mutator_aux.cpp52
1 files changed, 52 insertions, 0 deletions
diff --git a/mutator_aux.cpp b/mutator_aux.cpp
index 6a56352..2671e70 100644
--- a/mutator_aux.cpp
+++ b/mutator_aux.cpp
@@ -92,6 +92,18 @@ bool IsTheMatchInSysHeader(bool SysHeaderFlag, bool SysHeader, SourceLocation SL
return false;
}
}
+
+bool IsTheMatchInSysHeader(bool SysHeaderFlag, bool SysHeader)
+{
+ if (SysHeader && !SysHeaderFlag)
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+}
/*********************************************************************************************************************/
/*********************************************************************************************************************/
/*********************************************************************************************************************/
@@ -133,6 +145,18 @@ bool IsTheMatchInMainFile(bool MainFileFlag, bool MainFile, SourceLocation SL)
return false;
}
}
+
+bool IsTheMatchInMainFile(bool MainFileFlag, bool MainFile)
+{
+ if (MainFile || (!MainFile && !MainFileFlag))
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+}
/*********************************************************************************************************************/
/*********************************************************************************************************************/
/******************************************************XMLReport******************************************************/
@@ -220,6 +244,19 @@ void XMLReport::XMLAddNode(std::string FilePath, std::string MisraRule, std::str
RootPointer->InsertEndChild(MisraElement);
}
+void XMLReport::XMLAddNode(unsigned Line, unsigned Column, std::string FileName, std::string MisraRule, std::string Description)
+{
+ //assert(SL.isValid() && "SourceLocation Acquired by SourceManager in an overload(3) of XMLAddNode is not valid.");
+
+ XMLElement* MisraElement = XMLReportDoc.NewElement("MisraDiag");
+ MisraElement->SetText(Description.c_str());
+ MisraElement->SetAttribute("Misra-C:2004Rule", MisraRule.c_str());
+ MisraElement->SetAttribute("FileName", FileName.c_str());
+ MisraElement->SetAttribute("SpellingLineNumber", Line);
+ MisraElement->SetAttribute("SpellingColumnNumber", Column);
+ RootPointer->InsertEndChild(MisraElement);
+}
+
void XMLReport::SaveReport(void)
{
XMLError XMLErrorResult = XMLReportDoc.SaveFile("./test/misrareport.xml");
@@ -319,6 +356,21 @@ void JSONReport::JSONAddElement(std::string FilePath, std::string MisraRule, std
JSONRepFile << RepJ << std::endl;
}
+void JSONReport::JSONAddElement(unsigned Line, unsigned Column, std::string FileName, std::string MisraRule, std::string Description)
+{
+ //assert(SL.isValid() && "SourceLocation Acquired by SourceManager in an overload(3) of XMLAddNode is not valid.");
+
+ json RepJ;
+
+ RepJ["MisraDiag"]["Description"] = Description.c_str();
+ RepJ["MisraDiag"]["Misra-C:2004Rule"] = MisraRule.c_str();
+ RepJ["MisraDiag"]["FileName"] = FileName.c_str();
+ RepJ["MisraDiag"]["SpellingLineNumber"] = Line;
+ RepJ["MisraDiag"]["SpellingColumnNumber"] = Column;
+
+ JSONRepFile << RepJ << std::endl;
+}
+
void JSONReport::CloseReport(void)
{
JSONRepFile.close();