Changeset View
Changeset View
Standalone View
Standalone View
duchain/tests/duchain.cpp
Context not available. | |||||
623 | FunctionType::Ptr fun = top->localDeclarations().first()->type<FunctionType>(); | 623 | FunctionType::Ptr fun = top->localDeclarations().first()->type<FunctionType>(); | ||
---|---|---|---|---|---|
624 | QVERIFY(fun); | 624 | QVERIFY(fun); | ||
625 | QCOMPARE(fun->arguments().count(), 1); | 625 | QCOMPARE(fun->arguments().count(), 1); | ||
626 | QVERIFY(IntegralType::Ptr::dynamicCast(fun->arguments().first())); | | |||
627 | QVERIFY(IntegralType::Ptr::dynamicCast(fun->arguments().first())->dataType() == IntegralType::TypeArray); | | |||
628 | 626 | | |||
629 | IntegralType::Ptr type = top->childContexts().first()->localDeclarations().first()->type<IntegralType>(); | 627 | AbstractType::Ptr arg = fun->arguments().first(); | ||
630 | QVERIFY(type); | 628 | QVERIFY(arg); | ||
631 | QVERIFY(type->dataType() == IntegralType::TypeArray); | 629 | QVERIFY(arg.cast<IndexedContainer>()); | ||
630 | QCOMPARE(arg.cast<IndexedContainer>()->typesCount(), 1); | ||||
631 | QCOMPARE(arg.cast<IndexedContainer>()->prettyName().str(), QStringLiteral("array")); | ||||
632 | | ||||
633 | AbstractType::Ptr typehint = arg.cast<IndexedContainer>()->typeAt(0).abstractType(); | ||||
634 | QVERIFY(typehint); | ||||
635 | QVERIFY(IntegralType::Ptr::dynamicCast(typehint)); | ||||
636 | QVERIFY(IntegralType::Ptr::dynamicCast(typehint)->dataType() == IntegralType::TypeMixed); | ||||
632 | } | 637 | } | ||
633 | 638 | | |||
634 | void TestDUChain::declareTypehintVariadicFunction() | 639 | void TestDUChain::declareTypehintVariadicFunction() | ||
Context not available. |