Unit test for "implement function" completion

Dmitry Risenberg dmitry.risenberg at gmail.com
Mon Mar 21 22:57:27 UTC 2011


I want to write a unit test for this:
https://bugs.kde.org/show_bug.cgi?id=255038.
I tried the following code, following other unit tests in test_cppcodecompletion

    QByteArray test = "class A {}; class B : public A { B(int i); };";
    TopDUContext* context = parse( test, DumpNone /*DumpDUChain | DumpAST */);
    DUChainWriteLocker lock(DUChain::lock());
    CompletionItemTester tester(context, "");

"" - stands for pressing a Ctrl+Space.

However, tester.items contains only two items - "A" and "B" - and no
item "implement constructor", while completion in a file with the same
contents has an entry for implementing constructor. What am I doing
wrong?

-- 
Dmitry Risenberg




More information about the KDevelop-devel mailing list