| 668 | } |
| 669 | |
| 670 | void TestDUChain::testBaseClasses() |
| 671 | { |
| 672 | TestFile file(QStringLiteral("class Base {}; class Inherited : public Base {};"), QStringLiteral("cpp")); |
| 673 | QVERIFY(file.parseAndWait()); |
| 674 | |
| 675 | DUChainReadLocker lock; |
| 676 | DUContext* top = file.topContext().data(); |
| 677 | QVERIFY(top); |
| 678 | |
| 679 | QCOMPARE(top->localDeclarations().count(), 2); |
| 680 | Declaration* baseDecl = top->localDeclarations().first(); |
| 681 | QCOMPARE(baseDecl->identifier(), Identifier(u"Base")); |
| 682 | |
| 683 | ClassDeclaration* inheritedDecl = dynamic_cast<ClassDeclaration*>(top->localDeclarations()[1]); |
| 684 | QCOMPARE(inheritedDecl->identifier(), Identifier(u"Inherited")); |
| 685 | |
| 686 | QVERIFY(inheritedDecl); |
| 687 | QCOMPARE(inheritedDecl->baseClassesSize(), 1u); |
| 688 | |
| 689 | QCOMPARE(baseDecl->uses().count(), 1); |
| 690 | QCOMPARE(baseDecl->uses().first().count(), 1); |
| 691 | QCOMPARE(baseDecl->uses().first().first(), RangeInRevision(0, 40, 0, 44)); |
| 692 | } |
| 693 | |
| 694 | void TestDUChain::testReparseBaseClasses() |
| 695 | { |
nothing calls this directly
no test coverage detected