diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2016-02-12 15:07:45 -0800 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2016-02-12 16:47:24 -0800 |
commit | ce1d8561b49a913ff7a15f67747886f1cfc64440 (patch) | |
tree | c434c863e6701bf7757dd96466e465e8f91b7a8e /test/api | |
parent | d742c2d3eb3b8f669f0df9c6e5f6596eaf8fb616 (diff) | |
download | qtlocation-mapboxgl-ce1d8561b49a913ff7a15f67747886f1cfc64440.tar.gz |
[tests] Add test for Map::updatePointAnnotation
Diffstat (limited to 'test/api')
-rw-r--r-- | test/api/annotations.cpp | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/test/api/annotations.cpp b/test/api/annotations.cpp index 3e74d79d08..8e21b615a1 100644 --- a/test/api/annotations.cpp +++ b/test/api/annotations.cpp @@ -130,7 +130,7 @@ TEST(Annotations, NonImmediateAdd) { checkRendering(map, "non_immediate_add"); } -TEST(Annotations, UpdatePoint) { +TEST(Annotations, UpdateIcon) { auto display = std::make_shared<mbgl::HeadlessDisplay>(); HeadlessView view(display, 1); OnlineFileSource fileSource; @@ -146,6 +146,24 @@ TEST(Annotations, UpdatePoint) { map.addAnnotationIcon("flipped_marker", namedMarker("flipped_marker.png")); map.update(Update::Annotations); + checkRendering(map, "update_icon"); +} + +TEST(Annotations, UpdatePoint) { + auto display = std::make_shared<mbgl::HeadlessDisplay>(); + HeadlessView view(display, 1); + OnlineFileSource fileSource; + + Map map(view, fileSource, MapMode::Still); + map.setStyleJSON(util::read_file("test/fixtures/api/empty.json"), ""); + map.addAnnotationIcon("default_marker", namedMarker("default_marker.png")); + map.addAnnotationIcon("flipped_marker", namedMarker("flipped_marker.png")); + AnnotationID point = map.addPointAnnotation(PointAnnotation({ 0, 0 }, "default_marker")); + + test::render(map); + + map.updatePointAnnotation(point, PointAnnotation({ 0, -10 }, "flipped_marker")); + checkRendering(map, "update_point"); } @@ -157,7 +175,7 @@ TEST(Annotations, RemovePoint) { Map map(view, fileSource, MapMode::Still); map.setStyleJSON(util::read_file("test/fixtures/api/empty.json"), ""); map.addAnnotationIcon("default_marker", namedMarker("default_marker.png")); - uint32_t point = map.addPointAnnotation(PointAnnotation({ 0, 0 }, "default_marker")); + AnnotationID point = map.addPointAnnotation(PointAnnotation({ 0, 0 }, "default_marker")); test::render(map); @@ -179,7 +197,7 @@ TEST(Annotations, RemoveShape) { Map map(view, fileSource, MapMode::Still); map.setStyleJSON(util::read_file("test/fixtures/api/empty.json"), ""); - uint32_t shape = map.addShapeAnnotation(ShapeAnnotation(segments, properties)); + AnnotationID shape = map.addShapeAnnotation(ShapeAnnotation(segments, properties)); test::render(map); |