C++ duchain unit tests

Milian Wolff mail at milianw.de
Thu Jun 17 21:07:22 UTC 2010


On Thursday 17 June 2010 22:55:51 Milian Wolff wrote:
> On Thursday 17 June 2010 22:49:15 Milian Wolff wrote:
> > On Thursday 17 June 2010 22:19:32 Milian Wolff wrote:
> > > On Thursday 17 June 2010 21:42:31 Nicolás Alvarez wrote:
> > > > On 6/17/10, Nicolás Alvarez <nicolas.alvarez at gmail.com> wrote:
> > > > > I modified testDeclareUsingNamespace to dump duchain, and when run
> > > > > alone, the foo::bar declaration indeed has zero uses; while when
> > > > > run after testLocalNamespaceAlias, there is a properly-ranged use.
> > > 
> > > Yep, can reproduce that.
> > > 
> > > > If I paste the test snippet in a normal C++ file, the 'bar' inside
> > > > main() is underlined yellow. As soon as I type *anything* else (like
> > > > adding a newline at the end), it's properly marked as a use. Pretty
> > > > fragile stuff...
> > > 
> > > works for me :P Anyhow, since the above is reproducable I'll have a
> > > look at it. Bye
> > 
> > The difference is in cppducontext.cpp:
> > 
> > in loc 234 in the conditional:
> > 
> > m_source != m_context
> > 
> > When running both tests one after the other, those pointers are equal.
> > When running only one of them they are different...
> 
> false alarm,  either I'm blind or it's random :D

Well, the contexts _are_ different. But it works in one case since it somehow 
finds the declaration of the function bar() of the test before. If we change 
the testcase with different names it's broken in that case as well...
-- 
Milian Wolff
mail at milianw.de
http://milianw.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20100617/6d43ef3d/attachment.sig>


More information about the KDevelop-devel mailing list