MCPcopy Create free account
hub / github.com/KDE/kdevelop / testGlobalFunctionDeclaration

Method testGlobalFunctionDeclaration

plugins/clang/tests/test_duchain.cpp:803–814  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

801}
802
803void TestDUChain::testGlobalFunctionDeclaration()
804{
805 TestFile file(QStringLiteral("void foo(int arg1, char arg2);\n"), QStringLiteral("cpp"));
806 file.parse(TopDUContext::AllDeclarationsContextsAndUses);
807 file.waitForParsed();
808
809 DUChainReadLocker lock;
810 QVERIFY(file.topContext());
811 QCOMPARE(file.topContext()->localDeclarations().size(), 1);
812 QCOMPARE(file.topContext()->childContexts().size(), 1);
813 QVERIFY(!file.topContext()->childContexts().first()->inSymbolTable());
814}
815
816void TestDUChain::testFunctionDefinitionVsDeclaration()
817{

Callers

nothing calls this directly

Calls 8

waitForParsedMethod · 0.80
localDeclarationsMethod · 0.80
childContextsMethod · 0.80
parseMethod · 0.45
topContextMethod · 0.45
sizeMethod · 0.45
inSymbolTableMethod · 0.45
firstMethod · 0.45

Tested by

no test coverage detected