| 129 | } |
| 130 | |
| 131 | void TestProblemsView::testAddRemoveProblems() |
| 132 | { |
| 133 | ProblemModelSet* pms = ICore::self()->languageController()->problemModelSet(); |
| 134 | ProblemModel* model = pms->findModel(QStringLiteral("MODEL2_ID")); |
| 135 | QVERIFY(model); |
| 136 | |
| 137 | QTabWidget* tab = tabWidget(); |
| 138 | QVERIFY(tab); |
| 139 | |
| 140 | // Make sure there are no problems right now |
| 141 | model->clearProblems(); |
| 142 | QCOMPARE(tab->tabText(0), QStringLiteral("MODEL2 (0)")); |
| 143 | |
| 144 | // Let's add some problems |
| 145 | int c = 0; |
| 146 | for (int i = 0; i < 3; i++) { |
| 147 | IProblem::Ptr p(new DetectedProblem()); |
| 148 | model->addProblem(p); |
| 149 | c++; |
| 150 | |
| 151 | // Check if the view has noticed the addition |
| 152 | QString label = QStringLiteral("MODEL2 (%1)").arg(c); |
| 153 | QCOMPARE(tab->tabText(0), label); |
| 154 | } |
| 155 | |
| 156 | // Clear the problems |
| 157 | model->clearProblems(); |
| 158 | |
| 159 | // Check if the view has noticed the clear |
| 160 | QCOMPARE(tab->tabText(0), QStringLiteral("MODEL2 (0)")); |
| 161 | } |
| 162 | |
| 163 | void TestProblemsView::testSetProblems() |
| 164 | { |
nothing calls this directly
no test coverage detected