[Marble-bugs] [marble] [Bug 334289] New: Extend the GeoDataWriter unit test to test operator== of GeoDataDocument

Dennis Nienhüser earthwings at gentoo.org
Sat May 3 16:51:44 UTC 2014


https://bugs.kde.org/show_bug.cgi?id=334289

            Bug ID: 334289
           Summary: Extend the GeoDataWriter unit test to test operator==
                    of GeoDataDocument
    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
        Depends on: 334286

TestGeoDataWriter has a unit test method saveAndCompare (along with
saveAndCompare_data) which iterates over all .kml files in tests/data and does
the following:
- parse the file, retrieve the GeoDataDocument as result
- write the document to a KML file in memory (QBuffer/QByteArray)
- compare the XML contents of the original file and the file in memory for
equality.

This is fine for simple cases, but limits the possible input .kml files: They
cannot have tags with default values and the order of tags must be exactly the
one which Marble uses internally. To allow adding .kml files in the future as
test cases which are not limited by this, write a similar unit test which does
the comparison using GeoDataDocument::operator== instead of the XML string
comparison. Use the existing saveAndCompare unit test as a base for a new unit
test saveAndCompareEquality(). Instead of doing the QTextStream based
comparison, parse the QBuffer contents, retrieve the GeoDataDocument from the
parser and compare it with the original one (make sure not to compare
pointers).

Make sure to compile Marble with the BUILD_MARBLE_TESTS=TRUE option enabled and
run the test case from the build folder (run tests/TestEquality). Submit a
review request at https://git.reviewboard.kde.org.

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