Changeset View
Changeset View
Standalone View
Standalone View
duchain/tests/uses.cpp
Show First 20 Lines • Show All 1724 Lines • ▼ Show 20 Line(s) | 1718 | void TestUses::defaultValue() { | |||
---|---|---|---|---|---|
1725 | QCOMPARE(a->identifier().toString(), QString("a")); | 1725 | QCOMPARE(a->identifier().toString(), QString("a")); | ||
1726 | compareUses(a, QList<RangeInRevision>() << RangeInRevision(0, 44, 0, 45)); | 1726 | compareUses(a, QList<RangeInRevision>() << RangeInRevision(0, 44, 0, 45)); | ||
1727 | 1727 | | |||
1728 | Declaration *c = top->childContexts().at(0)->localDeclarations().at(0); | 1728 | Declaration *c = top->childContexts().at(0)->localDeclarations().at(0); | ||
1729 | QCOMPARE(c->identifier().toString(), QString("C")); | 1729 | QCOMPARE(c->identifier().toString(), QString("C")); | ||
1730 | compareUses(c, QList<RangeInRevision>() << RangeInRevision(0, 47, 0, 48)); | 1730 | compareUses(c, QList<RangeInRevision>() << RangeInRevision(0, 47, 0, 48)); | ||
1731 | } | 1731 | } | ||
1732 | 1732 | | |||
1733 | void TestUses::propertyType() { | ||||
1734 | // 0 1 2 3 4 | ||||
1735 | // 01234567890123456789012345678901234567890123456 | ||||
1736 | QByteArray method("<? class A { public A $foo; }"); | ||||
1737 | TopDUContext *top = parse(method, DumpNone); | ||||
1738 | DUChainReleaser releaseTop(top); | ||||
1739 | DUChainWriteLocker lock(DUChain::lock()); | ||||
1740 | | ||||
1741 | Declaration *a = top->localDeclarations().at(0); | ||||
1742 | QCOMPARE(a->identifier().toString(), QString("a")); | ||||
1743 | compareUses(a, QList<RangeInRevision>() << RangeInRevision(0, 20, 0, 21)); | ||||
1744 | } | ||||
1745 | | ||||
1733 | } | 1746 | } | ||
1734 | 1747 | |