| 491 | } |
| 492 | |
| 493 | void TestDUChain::testReparseError() |
| 494 | { |
| 495 | TestFile file(QStringLiteral("int i = 1 / 0;\n"), QStringLiteral("cpp")); |
| 496 | file.parse(TopDUContext::AllDeclarationsContextsAndUses); |
| 497 | |
| 498 | for (int i = 0; i < 2; ++i) { |
| 499 | QVERIFY(file.waitForParsed(500)); |
| 500 | DUChainReadLocker lock; |
| 501 | QVERIFY(file.topContext()); |
| 502 | if (!i) { |
| 503 | QCOMPARE(file.topContext()->problems().size(), 1); |
| 504 | file.setFileContents(QStringLiteral("int i = 0;\n")); |
| 505 | } else { |
| 506 | QCOMPARE(file.topContext()->problems().size(), 0); |
| 507 | } |
| 508 | |
| 509 | file.parse(TopDUContext::AllDeclarationsContextsAndUses | TopDUContext::ForceUpdateRecursive); |
| 510 | } |
| 511 | } |
| 512 | |
| 513 | void TestDUChain::testTemplate() |
| 514 | { |
nothing calls this directly
no test coverage detected