| 138 | } |
| 139 | |
| 140 | void 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 | |
| 183 | void TestDetectedProblem::testPluginName() |
| 184 | { |
nothing calls this directly
no test coverage detected