MCPcopy Create free account
hub / github.com/KDE/kdevelop / checkDiagnodes

Function checkDiagnodes

kdevplatform/shell/tests/test_filteredproblemstore.cpp:144–165  ·  view source on GitHub ↗

Compares the node and it's children to a reference problem and it's diagnostics

Source from the content-addressed store, hash-verified

142
143// Compares the node and it's children to a reference problem and it's diagnostics
144bool checkDiagnodes(const ProblemStoreNode *node, const IProblem::Ptr &reference)
145{
146 const auto *problemNode = dynamic_cast<const ProblemNode*>(node);
147 MYVERIFY(problemNode);
148 MYCOMPARE(problemNode->problem()->description(), reference->description());
149 MYCOMPARE(problemNode->problem()->finalLocation().document.str(), reference->finalLocation().document.str());
150 MYCOMPARE(problemNode->count(), 1);
151
152 const IProblem::Ptr diag = reference->diagnostics().at(0);
153 const auto *diagNode = dynamic_cast<const ProblemNode*>(problemNode->child(0));
154 MYVERIFY(diagNode);
155 MYCOMPARE(diagNode->problem()->description(), diag->description());
156 MYCOMPARE(diagNode->count(), 1);
157
158 const IProblem::Ptr diagdiag = diag->diagnostics().at(0);
159 const auto *diagdiagNode = dynamic_cast<const ProblemNode*>(diagNode->child(0));
160 MYVERIFY(diagdiagNode);
161 MYCOMPARE(diagdiagNode->problem()->description(), diagdiag->description());
162 MYCOMPARE(diagdiagNode->count(), 0);
163
164 return true;
165}
166
167void TestFilteredProblemStore::testNoGrouping()
168{

Callers 3

testNoGroupingMethod · 0.85
testPathGroupingMethod · 0.85
testSeverityGroupingMethod · 0.85

Calls 7

strMethod · 0.80
descriptionMethod · 0.45
finalLocationMethod · 0.45
countMethod · 0.45
atMethod · 0.45
diagnosticsMethod · 0.45
childMethod · 0.45

Tested by

no test coverage detected