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

Method testAddRemoveProblems

plugins/problemreporter/tests/test_problemsview.cpp:131–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129}
130
131void 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
163void TestProblemsView::testSetProblems()
164{

Callers

nothing calls this directly

Calls 5

problemModelSetMethod · 0.80
languageControllerMethod · 0.80
findModelMethod · 0.80
clearProblemsMethod · 0.45
addProblemMethod · 0.45

Tested by

no test coverage detected