[Marble-bugs] [marble] [Bug 331666] New: Test equality of GeoDataObject derived classes
Dennis Nienhüser
earthwings at gentoo.org
Sat Mar 1 22:37:56 UTC 2014
https://bugs.kde.org/show_bug.cgi?id=331666
Bug ID: 331666
Summary: Test equality of GeoDataObject derived classes
Classification: Unclassified
Product: marble
Version: 1.7 (KDE 4.12)
Platform: unspecified
OS: Linux
Status: UNCONFIRMED
Keywords: google-code-in, junior-jobs
Severity: task
Priority: NOR
Component: general
Assignee: marble-bugs at kde.org
Reporter: earthwings at gentoo.org
Currently operator== in GeoData* classes does check for equality of the id()
and targetId() of GeoDataObject derived classes. This task should fix this.
- Add a protected method with the following signature to GeoDataObject.h:
bool equals(const GeoDataObject &other) const;
- Implement the method like operator==, i.e. return true if d->m_id and
d->m_targetId equal the ones of the other object each
- Find all GeoData* classes which have operator== implemented and are derived
from GeoDataObject in some way. For example, GeoDataItemIcon is a direct child,
GeoDataFlyTo is one because it inherits GeoDataTourPrimitive which inherits
GeoDataObject. In their operator== implementation, call
equals( other )
before checking the members of the object, e.g.
bool GeoDataFlyTo::operator==( const GeoDataFlyTo& other ) const
{
return equals( other ) &&
d->m_duration == other.d->m_duration &&
d->m_flyToMode == other.d->m_flyToMode &&
d->m_view == other.d->m_view;
}
Make sure to compile Marble with the following cmake options enabled:
BUILD_MARBLE_TESTS=TRUE, BUILD_MARBLE_TOOLS=TRUE. Execute tests/TestEquality
and make sure no errors come up. Use tools/kml2kml to analyze errors and fix
the tag writers, if needed. Submit a review request at
https://git.reviewboard.kde.org with the marble group as reviewers.
Please leave a comment here (e.g. "I want to work on this task.") if you start
working on this task to avoid multiple people working on it at the same time.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the Marble-bugs
mailing list