| 354 | Q_DECLARE_METATYPE(ExpectedTodos) |
| 355 | |
| 356 | void 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 | |
| 379 | void TestProblems::testTodoProblems_data() |
| 380 | { |
nothing calls this directly
no test coverage detected