Changeset View
Changeset View
Standalone View
Standalone View
duchain/tests/duchain.cpp
Context not available. | |||||
512 | QCOMPARE(var->isStatic(), false); | 512 | QCOMPARE(var->isStatic(), false); | ||
---|---|---|---|---|---|
513 | QVERIFY(var->type<IntegralType>()); | 513 | QVERIFY(var->type<IntegralType>()); | ||
514 | QVERIFY(var->type<IntegralType>()->dataType() == IntegralType::TypeInt); | 514 | QVERIFY(var->type<IntegralType>()->dataType() == IntegralType::TypeInt); | ||
515 | QVERIFY(var->range() == RangeInRevision(0, 54, 0, 56)); | 515 | QVERIFY(var->range() == RangeInRevision(0, 55, 0, 56)); | ||
516 | } | 516 | } | ||
517 | 517 | | |||
518 | void TestDUChain::classMemberVarDocBlockType() | 518 | void TestDUChain::classMemberVarDocBlockType() | ||
Context not available. | |||||
2479 | QCOMPARE(dec->uses().keys().count(), 1); | 2479 | QCOMPARE(dec->uses().keys().count(), 1); | ||
2480 | QCOMPARE(dec->uses().values().count(), 1); | 2480 | QCOMPARE(dec->uses().values().count(), 1); | ||
2481 | QCOMPARE(dec->uses().values().first().count(), 2); | 2481 | QCOMPARE(dec->uses().values().first().count(), 2); | ||
2482 | QCOMPARE(dec->uses().values().first().first(), RangeInRevision(0, 3, 0, 8)); | 2482 | QCOMPARE(dec->uses().values().first().first(), RangeInRevision(0, 4, 0, 8)); | ||
2483 | QCOMPARE(dec->uses().values().first().at(1), RangeInRevision(0, 27, 0, 32)); | 2483 | QCOMPARE(dec->uses().values().first().at(1), RangeInRevision(0, 28, 0, 32)); | ||
2484 | } | 2484 | } | ||
2485 | 2485 | | |||
2486 | void TestDUChain::returnWithoutFunction() | 2486 | void TestDUChain::returnWithoutFunction() | ||
Context not available. | |||||
2912 | QCOMPARE(dec->uses().values().count(), 1); | 2912 | QCOMPARE(dec->uses().values().count(), 1); | ||
2913 | QCOMPARE(dec->uses().values().first().count(), 4); | 2913 | QCOMPARE(dec->uses().values().first().count(), 4); | ||
2914 | qDebug() << dec->uses().values().first().at(0).castToSimpleRange(); | 2914 | qDebug() << dec->uses().values().first().at(0).castToSimpleRange(); | ||
2915 | QCOMPARE(dec->uses().values().first().at(0), RangeInRevision(1, 16, 1, 20)); | 2915 | QCOMPARE(dec->uses().values().first().at(0), RangeInRevision(1, 17, 1, 20)); | ||
2916 | qDebug() << dec->uses().values().first().at(1).castToSimpleRange(); | 2916 | qDebug() << dec->uses().values().first().at(1).castToSimpleRange(); | ||
2917 | QCOMPARE(dec->uses().values().first().at(1), RangeInRevision(1, 35, 1, 39)); | 2917 | QCOMPARE(dec->uses().values().first().at(1), RangeInRevision(1, 36, 1, 39)); | ||
2918 | qDebug() << dec->uses().values().first().at(2).castToSimpleRange(); | 2918 | qDebug() << dec->uses().values().first().at(2).castToSimpleRange(); | ||
2919 | QCOMPARE(dec->uses().values().first().at(2), RangeInRevision(2, 0, 2, 4)); | 2919 | QCOMPARE(dec->uses().values().first().at(2), RangeInRevision(2, 1, 2, 4)); | ||
2920 | qDebug() << dec->uses().values().first().at(3).castToSimpleRange(); | 2920 | qDebug() << dec->uses().values().first().at(3).castToSimpleRange(); | ||
2921 | QCOMPARE(dec->uses().values().first().at(3), RangeInRevision(3, 0, 3, 4)); | 2921 | QCOMPARE(dec->uses().values().first().at(3), RangeInRevision(3, 1, 3, 4)); | ||
2922 | } | 2922 | } | ||
2923 | 2923 | | |||
2924 | { // check if asdf got declared | 2924 | { // check if asdf got declared | ||
Context not available. | |||||
3886 | QVERIFY(top->problems().isEmpty()); | 3886 | QVERIFY(top->problems().isEmpty()); | ||
3887 | QList< Declaration* > decs = top->findLocalDeclarations(Identifier(QStringLiteral("a"))); | 3887 | QList< Declaration* > decs = top->findLocalDeclarations(Identifier(QStringLiteral("a"))); | ||
3888 | QCOMPARE(decs.size(), 1); | 3888 | QCOMPARE(decs.size(), 1); | ||
3889 | QCOMPARE(decs.at(0)->range(), RangeInRevision(1, 19, 1, 21)); | 3889 | QCOMPARE(decs.at(0)->range(), RangeInRevision(1, 20, 1, 21)); | ||
3890 | QCOMPARE(decs.at(0)->uses().count(), 1); | 3890 | QCOMPARE(decs.at(0)->uses().count(), 1); | ||
3891 | QCOMPARE(decs.at(0)->uses().begin()->count(), 1); | 3891 | QCOMPARE(decs.at(0)->uses().begin()->count(), 1); | ||
3892 | QCOMPARE(decs.at(0)->uses().begin()->first(), RangeInRevision(2, 2, 2, 4)); | 3892 | QCOMPARE(decs.at(0)->uses().begin()->first(), RangeInRevision(2, 3, 2, 4)); | ||
3893 | } | 3893 | } | ||
3894 | 3894 | | |||
3895 | 3895 | | |||
Context not available. |