New test with C++11 and lambda (UDSEntry testcase)

Kevin Ottens ervin at kde.org
Mon Sep 23 06:36:25 UTC 2013


On Sunday 22 September 2013 11:57:32 Volker Krause wrote:
> On Saturday 21 September 2013 19:18:01 Mark wrote:
> > I've just created a quite complicated testcase for frameworks which uses
> > the new signal/slot connection syntax (since Qt 5.0) and uses a lambda as
> > slot. The reason i did this is so that i can keep then entire testcase
> > (minus the initialization) contained in one testcase method. Otherwise i
> > would have to make signal/slot connections to member functions which is
> > probably not something you want for testcases..
> > 
> > You can find the patch here: http://paste.kde.org/p9f82c70a/
> > 
> > Would this be OK to commit?
> > 
> > This testcase would obviously have to be extended a bit to test the
> > different detail states for UDSEntry. This test only tests the case where
> > UDSEntry is filled with details set to 0. The default is details set to 2
> > which this test doesn't test (yet).
> > 
> > I guess the question really is:
> > - Can i use C++11 for testcases?
> > - Can i use Lambda? The Lambda spec is supported since GCC 4.5.
> > http://gcc.gnu.org/projects/cxx0x.html
> 
> yes:
> http://community.kde.org/Frameworks/Policies#Frameworks_compiler_requirement
> s_and_C.2B.2B11
> 
> Unconditionally adding -std=c++0x as you did it will probably break MSVC
> though. There it's on by default, so a if(NOT MSVC) should fix that. This
> might be something we want to set globally together with other compiler
> flags, ecm's KDECompilerSettings.cmake comes to mind.

We definitely should do that ASAP. That would be the second use of "-
std=c++0x" which as you point out just reduces the portability. Anyone fancies 
a proper patch for ECM?

Regards.
-- 
Kévin Ottens, http://ervin.ipsquad.net

Sponsored by KDAB to work on KDE Frameworks
KDAB - proud supporter of KDE, http://www.kdab.com

-------------- 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/kde-frameworks-devel/attachments/20130923/c8a8a5b5/attachment-0001.sig>


More information about the Kde-frameworks-devel mailing list