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

Method testTodoProblems

plugins/clang/tests/test_problems.cpp:356–377  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

354Q_DECLARE_METATYPE(ExpectedTodos)
355
356void TestProblems::testTodoProblems()
357{
358 QFETCH(QString, code);
359 QFETCH(ExpectedTodos, expectedTodos);
360
361 TestFile file(code, QStringLiteral("cpp"));
362 QVERIFY(file.parseAndWait());
363
364 DUChainReadLocker lock;
365 auto top = file.topContext();
366 QVERIFY(top);
367 auto problems = top->problems();
368 QCOMPARE(problems.size(), expectedTodos.size());
369
370 for (int i = 0; i < problems.size(); ++i) {
371 auto problem = problems[i];
372 auto expectedTodo = expectedTodos[i];
373 QCOMPARE(problem->description(), expectedTodo.description);
374 QCOMPARE(problem->finalLocation().start(), expectedTodo.start);
375 QCOMPARE(problem->finalLocation().end(), expectedTodo.end);
376 }
377}
378
379void TestProblems::testTodoProblems_data()
380{

Callers

nothing calls this directly

Calls 8

parseAndWaitMethod · 0.80
topContextMethod · 0.45
problemsMethod · 0.45
sizeMethod · 0.45
descriptionMethod · 0.45
startMethod · 0.45
finalLocationMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected