~ubuntu-branches/ubuntu/quantal/kdevelop-php/quantal-proposed

« back to all changes in this revision

Viewing changes to duchain/tests/duchain.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Rohan Garg
  • Date: 2011-07-30 22:17:40 UTC
  • mfrom: (1.2.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20110730221740-xinifwwz87dk2lfc
Tags: 1.2.3-0ubuntu1
* New upstream release
  - Bump kdevplatform-dev to 1.2.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
2429
2429
    QVERIFY(!dynamic_cast<NamespaceAliasDeclaration*>(dec)->importIdentifier().explicitlyGlobal());
2430
2430
}
2431
2431
 
 
2432
void TestDUChain::namespaceStaticVar()
 
2433
{
 
2434
    //               0         1         2         3         4         5         6         7
 
2435
    //               01234567890123456789012345678901234567890123456789012345678901234567890123456789
 
2436
    TopDUContext* top = parse("<?php\n"
 
2437
                              "namespace ns {\n"
 
2438
                              "class c{ static public $foo; }\n"
 
2439
                              "}\n"
 
2440
                              "namespace {\n"
 
2441
                              "\\ns\\c::$foo;\n"
 
2442
                              "}\n"
 
2443
                              , DumpNone);
 
2444
    QVERIFY(top);
 
2445
    DUChainReleaser releaseTop(top);
 
2446
    DUChainWriteLocker lock;
 
2447
 
 
2448
    QVERIFY(top->problems().isEmpty());
 
2449
    Declaration* fooDec = top->findDeclarations(QualifiedIdentifier("ns::c::foo")).first();
 
2450
    QVERIFY(fooDec);
 
2451
 
 
2452
    QVERIFY(!fooDec->uses().isEmpty());
 
2453
    QVERIFY(!fooDec->uses().begin()->isEmpty());
 
2454
    QCOMPARE(fooDec->uses().begin()->begin()->start.line, 5);
 
2455
}
 
2456
 
2432
2457
struct TestUse {
2433
2458
    TestUse(const QString& _id, Declaration::Kind _kind, int _uses)
2434
2459
        : id(_id), kind(_kind), uses(_uses)