[Marble-devel] Review Request 116531: Equality operator for GeoDataTour and related classes
Dennis Nienhüser
earthwings at gentoo.org
Sun Mar 2 16:05:11 UTC 2014
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/116531/#review51670
-----------------------------------------------------------
src/lib/marble/geodata/data/GeoDataTour.cpp
<https://git.reviewboard.kde.org/r/116531/#comment36773>
Must instead be
return *d->m_playlist == *other.d->m_playlist;
otherwise you compare pointers.
tests/TestEquality.cpp
<https://git.reviewboard.kde.org/r/116531/#comment36771>
You're comparing pointers here! That's not what we want to do. Furthermore the two tours should be equal at this point because you've added the same number of default constructed playlist primitives in the same order.
There's an ownership problem in the way the primitives are used here. You need to create them on the heap because GeoDataTour will take ownership of them and delete them when it is destructed (missing in the code currently, but intended to behave like that). Therefore please change
GeoDataAnimatedUpdate animatedUpdate1;
to
GeoDataAnimatedUpdate* animatedUpdate1 = new GeoDataAnimatedUpdate;
and so on, and change
playlist1.addPrimitive( &animatedUpdate1 );
to
playlist1.addPrimitive( animatedUpdate1 );
etc.
Similar for the compare/verify calls, change
QCOMPARE( &tour1, &tour1 );
to
QCOMPARE( tour1, tour1 );
- Dennis Nienhüser
On March 2, 2014, 1:48 p.m., Sanjiban Bairagya wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/116531/
> -----------------------------------------------------------
>
> (Updated March 2, 2014, 1:48 p.m.)
>
>
> Review request for Marble.
>
>
> Bugs: 331671
> http://bugs.kde.org/show_bug.cgi?id=331671
>
>
> Repository: marble
>
>
> Description
> -------
>
> Added operator== and operator!= to GeoDataAnimatedUpdate, GeoDataSoundCue, GeoDataTourControl, GeoDataWait, GeoDataPlaylist and GeoDataTour
>
>
> Diffs
> -----
>
> src/lib/marble/geodata/data/GeoDataAnimatedUpdate.h 420eebe
> src/lib/marble/geodata/data/GeoDataAnimatedUpdate.cpp 980e856
> src/lib/marble/geodata/data/GeoDataPlaylist.h d7ac52a
> src/lib/marble/geodata/data/GeoDataPlaylist.cpp d23175c
> src/lib/marble/geodata/data/GeoDataSoundCue.h 3029ff6
> src/lib/marble/geodata/data/GeoDataSoundCue.cpp 3507e96
> src/lib/marble/geodata/data/GeoDataTour.h 91ae5d7
> src/lib/marble/geodata/data/GeoDataTour.cpp d9567a6
> src/lib/marble/geodata/data/GeoDataTourControl.h e801bde
> src/lib/marble/geodata/data/GeoDataTourControl.cpp cc6b5cd
> src/lib/marble/geodata/data/GeoDataUpdate.h 2a376fd
> src/lib/marble/geodata/data/GeoDataUpdate.cpp a1650ca
> src/lib/marble/geodata/data/GeoDataWait.h 0d1bbcc
> src/lib/marble/geodata/data/GeoDataWait.cpp ce55704
> tests/TestEquality.cpp 7a37b02
>
> Diff: https://git.reviewboard.kde.org/r/116531/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Sanjiban Bairagya
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/marble-devel/attachments/20140302/3945f660/attachment.html>
More information about the Marble-devel
mailing list