| 1502 | } |
| 1503 | |
| 1504 | void TestDUChain::testMultiLineMacroRanges() |
| 1505 | { |
| 1506 | TestFile file(QStringLiteral("#define FUNC_MACROS(x) struct str##x{};\nFUNC_MACROS(x\n);"), QStringLiteral("cpp")); |
| 1507 | file.parse(TopDUContext::AllDeclarationsContextsAndUses); |
| 1508 | QVERIFY(file.waitForParsed(5000)); |
| 1509 | |
| 1510 | DUChainReadLocker lock; |
| 1511 | QVERIFY(file.topContext()); |
| 1512 | QCOMPARE(file.topContext()->localDeclarations().size(), 2); |
| 1513 | auto macroDefinition = file.topContext()->localDeclarations()[0]; |
| 1514 | QVERIFY(macroDefinition); |
| 1515 | QCOMPARE(macroDefinition->range(), RangeInRevision(0,8,0,19)); |
| 1516 | auto structDeclaration = file.topContext()->localDeclarations()[1]; |
| 1517 | QVERIFY(structDeclaration); |
| 1518 | QCOMPARE(structDeclaration->range(), RangeInRevision(1,0,1,0)); |
| 1519 | |
| 1520 | QCOMPARE(macroDefinition->uses().size(), 1); |
| 1521 | QCOMPARE(macroDefinition->uses().begin()->first(), RangeInRevision(1,0,1,11)); |
| 1522 | } |
| 1523 | |
| 1524 | void TestDUChain::testNestedMacroRanges() |
| 1525 | { |
nothing calls this directly
no test coverage detected