Review Request 117080: cleanup KDirModelTest

Alexander Richardson arichardson.kde at googlemail.com
Wed Mar 26 13:13:55 UTC 2014



> On March 26, 2014, 1:39 p.m., Mark Gaiser wrote:
> > autotests/kdirmodeltest.cpp, lines 55-56
> > <https://git.reviewboard.kde.org/r/117080/diff/1/?file=257310#file257310line55>
> >
> >     Do you really have to make defines for those signals? Sure, it looks fancy in the connect lines, but i personally prefer just &KDirLister::completed and &KDirLister::canceled.
> >     
> >     Perhaps others think differently?

Don't like #define much personally either, but that static_cast is quite ugly if we have it everywhere


> On March 26, 2014, 1:39 p.m., Mark Gaiser wrote:
> > autotests/kdirmodeltest.cpp, line 506
> > <https://git.reviewboard.kde.org/r/117080/diff/1/?file=257310#file257310line506>
> >
> >     same as previous

There is quite some code after that, not sure if it is fine to remove the disconnect


> On March 26, 2014, 1:39 p.m., Mark Gaiser wrote:
> > autotests/kdirmodeltest.cpp, line 525
> > <https://git.reviewboard.kde.org/r/117080/diff/1/?file=257310#file257310line525>
> >
> >     same as previous

Guess you are right, multiple calls to exitLoop (if they even happen) shouldn't matter


> On March 26, 2014, 1:39 p.m., Mark Gaiser wrote:
> > autotests/kdirmodeltest.cpp, line 588
> > <https://git.reviewboard.kde.org/r/117080/diff/1/?file=257310#file257310line588>
> >
> >     same as previous

will fix


> On March 26, 2014, 1:39 p.m., Mark Gaiser wrote:
> > autotests/kdirmodeltest.cpp, line 144
> > <https://git.reviewboard.kde.org/r/117080/diff/1/?file=257310#file257310line144>
> >
> >     You are also cleaning this one up in the cleanup() function, right?
> >     
> >     You might be fine removing this line in that case.

will fix


On March 26, 2014, 1:39 p.m., Alexander Richardson wrote:
> > As a general suggestion for those event loops and signal spy's. I don't know if this suggestion makes sense for KIO in test cases, but you "might" be able to prevent some (or all) event loops by using a lambda in the connect line: http://qt-project.org/wiki/New_Signal_Slot_Syntax#2f49cd0d473b52e6ddb8b377a34e6c36
> > 
> > I know this works well for listing entries, but i don't know if this works as a test case.

Would have to store the QObject::Connection in order to disconnect a lambda. Anyway the methods are there and work fine. I only did this in order to get rid of redefining connect.


- Alexander


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/117080/#review54177
-----------------------------------------------------------


On March 26, 2014, 1:13 p.m., Alexander Richardson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/117080/
> -----------------------------------------------------------
> 
> (Updated March 26, 2014, 1:13 p.m.)
> 
> 
> Review request for KDE Frameworks.
> 
> 
> Repository: kio
> 
> 
> Description
> -------
> 
> Use Qt5 new signal slot syntax for KDirModelTest
> 
> This allows removing #define connect(...) QVERIFY(QObject::connect(...)),
> since now the connections are checked at compile time.
> Also removed all disconnect calls at the end of a test, now this is done
> in cleanup() which is automatically called after each test case
> 
> Always use QTestEventLoop (as is the case now already)
> 
> This merely removes the #define and #ifdefs for it
> 
> 
> Diffs
> -----
> 
>   autotests/kdirmodeltest.h b8b41ec52a61a083c6c76e9184a556835551443e 
>   autotests/kdirmodeltest.cpp 5d59eba45495de30db5e70da2e80bb3d5cba424c 
> 
> Diff: https://git.reviewboard.kde.org/r/117080/diff/
> 
> 
> Testing
> -------
> 
> Test still passes (except for testFontUrlWithHost, but that has always timed out for me)
> 
> 
> Thanks,
> 
> Alexander Richardson
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20140326/797d4256/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list