Review Request: SoK - Unit Test : core/collections/support/TrackForUrlWorker
Matěj Laitl
matej at laitl.cz
Fri Jul 6 09:57:18 UTC 2012
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/105389/#review15450
-----------------------------------------------------------
Just minor things are left now:
tests/core/collections/support/TestTrackForUrlWorker.h
<http://git.reviewboard.kde.org/r/105389/#comment12076>
No need for this method.
tests/core/collections/support/TestTrackForUrlWorker.cpp
<http://git.reviewboard.kde.org/r/105389/#comment12085>
unused include
tests/core/collections/support/TestTrackForUrlWorker.cpp
<http://git.reviewboard.kde.org/r/105389/#comment12077>
code style: extra line.
tests/core/collections/support/TestTrackForUrlWorker.cpp
<http://git.reviewboard.kde.org/r/105389/#comment12078>
No! Threadweaver calls run() from itself in a thread!
tests/core/collections/support/TestTrackForUrlWorker.cpp
<http://git.reviewboard.kde.org/r/105389/#comment12079>
shorter: QVERIFY( receivedDone )
tests/core/collections/support/TestTrackForUrlWorker.cpp
<http://git.reviewboard.kde.org/r/105389/#comment12080>
You can use m_emittedTrack on the left side here. Also, why don't you use QCOMPARE? It gives better messages in case of error.
tests/core/collections/support/TestTrackForUrlWorker.cpp
<http://git.reviewboard.kde.org/r/105389/#comment12081>
code style: spacer around argument.
tests/mocks/MockTrackForUrlWorker.h
<http://git.reviewboard.kde.org/r/105389/#comment12083>
Originally I thought that "ad-hoc" is for mocks that are all defined inline in a test .cpp file.
tests/mocks/MockTrackForUrlWorker.h
<http://git.reviewboard.kde.org/r/105389/#comment12082>
No need to mention finishedLookup, I'd rather mention that it fetches the track from QTest data-driven testing variable named track and assigns it to m_track.
tests/mocks/MockTrackForUrlWorker.h
<http://git.reviewboard.kde.org/r/105389/#comment12084>
Hmm, if you have a .cpp file, I would put the implementation there.
- Matěj Laitl
On July 6, 2012, 8:54 a.m., Jasneet Bhatti wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/105389/
> -----------------------------------------------------------
>
> (Updated July 6, 2012, 8:54 a.m.)
>
>
> Review request for Amarok, Matěj Laitl and Sven Krohlas.
>
>
> Description
> -------
>
> Added unit test for core/collections/support/TrackForUrlWorker
>
> Just the one slot completeJob() to test.
> Tested for both KUrl and QString types of urls.
>
>
> Diffs
> -----
>
> tests/core/collections/CMakeLists.txt b01b655
> tests/core/collections/support/CMakeLists.txt PRE-CREATION
> tests/core/collections/support/TestTrackForUrlWorker.h PRE-CREATION
> tests/core/collections/support/TestTrackForUrlWorker.cpp PRE-CREATION
> tests/mocks/MockTrackForUrlWorker.h PRE-CREATION
> tests/mocks/MockTrackForUrlWorker.cpp PRE-CREATION
>
> Diff: http://git.reviewboard.kde.org/r/105389/diff/
>
>
> Testing
> -------
>
> Builds and runs fine.
>
>
> Thanks,
>
> Jasneet Bhatti
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/amarok-devel/attachments/20120706/2e7e603e/attachment.html>
More information about the Amarok-devel
mailing list