Skip to content

Commit 0c6b1a5

Browse files
committed
Change internal -> internalError, add premium-internalError with test
1 parent 8f63971 commit 0c6b1a5

2 files changed

Lines changed: 22 additions & 2 deletions

File tree

lib/analyzerinfo.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ bool AnalyzerInformation::skipAnalysis(const tinyxml2::XMLDocument &analyzerInfo
9797
for (const tinyxml2::XMLElement *e = rootNode->FirstChildElement(); e; e = e->NextSiblingElement()) {
9898
if (std::strcmp(e->Name(), "error") == 0 &&
9999
(e->Attribute("id", "premium-invalidLicense") ||
100-
e->Attribute("id", "internal")
100+
e->Attribute("id", "premium-internalError") ||
101+
e->Attribute("id", "internalError")
101102
))
102103
return false;
103104
}

test/testanalyzerinformation.cpp

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,25 @@ class TestAnalyzerInformation : public TestFixture, private AnalyzerInformation
119119
ASSERT_EQUALS(errorList.size(), 0);
120120
}
121121

122+
// Matching hash with premium internal error (don't skip)
123+
{
124+
std::list<ErrorMessage> errorList;
125+
tinyxml2::XMLDocument doc;
126+
127+
const tinyxml2::XMLError xmlError = doc.Parse(
128+
"<?xml version=\"1.0\"?>"
129+
"<analyzerinfo hash=\"100\">"
130+
"<error id=\"premium-internalError\" severity=\"error\" msg=\"Something went wrong\" verbose=\"Something went wrong\" file0=\"test.c\">"
131+
"<location file=\"Cppcheck\" line=\"0\" column=\"0\"/>"
132+
"</error>"
133+
"</analyzerinfo>"
134+
);
135+
ASSERT_EQUALS(xmlError, tinyxml2::XML_SUCCESS);
136+
137+
ASSERT_EQUALS(AnalyzerInformation::skipAnalysis(doc, 100, errorList), false);
138+
ASSERT_EQUALS(errorList.size(), 0);
139+
}
140+
122141
// Matching hash with internal error (don't skip)
123142
{
124143
std::list<ErrorMessage> errorList;
@@ -127,7 +146,7 @@ class TestAnalyzerInformation : public TestFixture, private AnalyzerInformation
127146
const tinyxml2::XMLError xmlError = doc.Parse(
128147
"<?xml version=\"1.0\"?>"
129148
"<analyzerinfo hash=\"100\">"
130-
"<error id=\"internal\" severity=\"error\" msg=\"Something went wrong\" verbose=\"Something went wrong\" file0=\"test.c\">"
149+
"<error id=\"internalError\" severity=\"error\" msg=\"Something went wrong\" verbose=\"Something went wrong\" file0=\"test.c\">"
131150
"<location file=\"Cppcheck\" line=\"0\" column=\"0\"/>"
132151
"</error>"
133152
"</analyzerinfo>"

0 commit comments

Comments
 (0)