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

Method testDefinitions

kdevplatform/language/duchain/tests/test_duchain.cpp:380–406  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

378#endif
379
380void TestDUChain::testDefinitions()
381{
382 DUChainReadLocker lock;
383 auto* const definitions = DUChain::definitions();
384 const DeclarationId id(QualifiedIdentifier{u"foo"});
385
386 QByteArray output;
387 const QTextStream stream(&output);
388
389 QCOMPARE(definitions->definitions(id), {});
390 definitions->dump(stream);
391 QCOMPARE(output, {});
392
393 const IndexedDeclaration indexed;
394 definitions->addDefinition(id, indexed);
395
396 QCOMPARE(definitions->definitions(id), {indexed});
397 definitions->dump(stream);
398 QCOMPARE(output, "Definitions for \"foo\" \n");
399 output.clear();
400
401 definitions->removeDefinition(id, indexed);
402
403 QCOMPARE(definitions->definitions(id), {});
404 definitions->dump(stream);
405 QCOMPARE(output, {});
406}
407
408void TestDUChain::testSymbolTableValid()
409{

Callers

nothing calls this directly

Calls 5

addDefinitionMethod · 0.80
removeDefinitionMethod · 0.80
definitionsMethod · 0.45
dumpMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected