Changeset View
Changeset View
Standalone View
Standalone View
shell/tests/test_detectedproblem.cpp
Show All 35 Lines | 34 | private slots: | |||
---|---|---|---|---|---|
36 | void cleanupTestCase(); | 36 | void cleanupTestCase(); | ||
37 | 37 | | |||
38 | void testSource(); | 38 | void testSource(); | ||
39 | void testSeverity(); | 39 | void testSeverity(); | ||
40 | void testDescription(); | 40 | void testDescription(); | ||
41 | void testExplanation(); | 41 | void testExplanation(); | ||
42 | void testFinalLocation(); | 42 | void testFinalLocation(); | ||
43 | void testDiagnostics(); | 43 | void testDiagnostics(); | ||
44 | void testPluginName(); | ||||
44 | 45 | | |||
45 | private: | 46 | private: | ||
46 | IProblem::Ptr m_problem; | 47 | IProblem::Ptr m_problem; | ||
47 | }; | 48 | }; | ||
48 | 49 | | |||
49 | void TestDetectedProblem::initTestCase() | 50 | void TestDetectedProblem::initTestCase() | ||
50 | { | 51 | { | ||
51 | AutoTestShell::init(); | 52 | AutoTestShell::init(); | ||
▲ Show 20 Lines • Show All 136 Lines • ▼ Show 20 Line(s) | 155 | { | |||
188 | QCOMPARE(m_problem->diagnostics().at(2)->description(), one); | 189 | QCOMPARE(m_problem->diagnostics().at(2)->description(), one); | ||
189 | QCOMPARE(m_problem->diagnostics().at(1)->description(), two); | 190 | QCOMPARE(m_problem->diagnostics().at(1)->description(), two); | ||
190 | QCOMPARE(m_problem->diagnostics().at(0)->description(), three); | 191 | QCOMPARE(m_problem->diagnostics().at(0)->description(), three); | ||
191 | 192 | | |||
192 | m_problem->clearDiagnostics(); | 193 | m_problem->clearDiagnostics(); | ||
193 | QCOMPARE(m_problem->diagnostics().size(), 0); | 194 | QCOMPARE(m_problem->diagnostics().size(), 0); | ||
194 | } | 195 | } | ||
195 | 196 | | |||
197 | void TestDetectedProblem::testPluginName() | ||||
198 | { | ||||
199 | DetectedProblem p1(QStringLiteral("Plugin1")); | ||||
200 | DetectedProblem p2(QStringLiteral("Plugin2")); | ||||
201 | DetectedProblem p3(QStringLiteral("")); | ||||
202 | DetectedProblem p4; | ||||
203 | | ||||
204 | QCOMPARE(p1.source(), IProblem::Plugin); | ||||
205 | QCOMPARE(p2.source(), IProblem::Plugin); | ||||
206 | QCOMPARE(p3.source(), IProblem::Plugin); | ||||
207 | QCOMPARE(p4.source(), IProblem::Unknown); | ||||
208 | | ||||
209 | QCOMPARE(p1.sourceString(), QStringLiteral("Plugin1")); | ||||
210 | QCOMPARE(p2.sourceString(), QStringLiteral("Plugin2")); | ||||
211 | QCOMPARE(p3.sourceString(), QStringLiteral("")); | ||||
212 | QCOMPARE(p4.sourceString(), i18n("Unknown")); | ||||
213 | | ||||
214 | p4.setSource(IProblem::Plugin); | ||||
215 | QCOMPARE(p4.source(), IProblem::Plugin); | ||||
216 | QCOMPARE(p4.sourceString(), i18n("Plugin")); | ||||
217 | } | ||||
196 | 218 | | |||
197 | QTEST_MAIN(TestDetectedProblem) | 219 | QTEST_MAIN(TestDetectedProblem) | ||
198 | 220 | | |||
199 | #include "test_detectedproblem.moc" | 221 | #include "test_detectedproblem.moc" |