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

Method testDiagnostics

kdevplatform/shell/tests/test_detectedproblem.cpp:140–181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138}
139
140void TestDetectedProblem::testDiagnostics()
141{
142 QString one = QStringLiteral("One");
143 QString two = QStringLiteral("Two");
144 QString three = QStringLiteral("Three");
145
146 IProblem::Ptr p1(new DetectedProblem());
147 IProblem::Ptr p2(new DetectedProblem());
148 IProblem::Ptr p3(new DetectedProblem());
149
150 p1->setDescription(one);
151 p2->setDescription(two);
152 p3->setDescription(three);
153
154 QCOMPARE(m_problem->diagnostics().size(), 0);
155
156 m_problem->addDiagnostic(p1);
157 m_problem->addDiagnostic(p2);
158 m_problem->addDiagnostic(p3);
159
160 QCOMPARE(m_problem->diagnostics().size(), 3);
161 QCOMPARE(m_problem->diagnostics().at(0)->description(), one);
162 QCOMPARE(m_problem->diagnostics().at(1)->description(), two);
163 QCOMPARE(m_problem->diagnostics().at(2)->description(), three);
164
165 m_problem->clearDiagnostics();
166 QCOMPARE(0, m_problem->diagnostics().size());
167
168 QVector<IProblem::Ptr> diags;
169 diags.push_back(p3);
170 diags.push_back(p2);
171 diags.push_back(p1);
172 m_problem->setDiagnostics(diags);
173
174 QCOMPARE(m_problem->diagnostics().size(), 3);
175 QCOMPARE(m_problem->diagnostics().at(2)->description(), one);
176 QCOMPARE(m_problem->diagnostics().at(1)->description(), two);
177 QCOMPARE(m_problem->diagnostics().at(0)->description(), three);
178
179 m_problem->clearDiagnostics();
180 QCOMPARE(m_problem->diagnostics().size(), 0);
181}
182
183void TestDetectedProblem::testPluginName()
184{

Callers

nothing calls this directly

Calls 9

setDescriptionMethod · 0.45
sizeMethod · 0.45
diagnosticsMethod · 0.45
addDiagnosticMethod · 0.45
descriptionMethod · 0.45
atMethod · 0.45
clearDiagnosticsMethod · 0.45
push_backMethod · 0.45
setDiagnosticsMethod · 0.45

Tested by

no test coverage detected