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

Method testReparseError

plugins/clang/tests/test_duchain.cpp:493–511  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

491}
492
493void 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
513void TestDUChain::testTemplate()
514{

Callers

nothing calls this directly

Calls 6

waitForParsedMethod · 0.80
parseMethod · 0.45
topContextMethod · 0.45
sizeMethod · 0.45
problemsMethod · 0.45
setFileContentsMethod · 0.45

Tested by

no test coverage detected