summaryrefslogtreecommitdiff
path: root/test/api
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2015-09-28 14:14:45 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2015-09-28 14:14:45 -0700
commit0156ac7c8ce7d22b8a68cc37fcb03b1271ef7a4e (patch)
treeb9eb55bccea005650afb538a83a05074ed10c541 /test/api
parentaf392b9434fd176704e564dfc22ee74f3a50cdf6 (diff)
downloadqtlocation-mapboxgl-0156ac7c8ce7d22b8a68cc37fcb03b1271ef7a4e.tar.gz
Add test for removeAnnotation
Diffstat (limited to 'test/api')
-rw-r--r--test/api/annotations.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/api/annotations.cpp b/test/api/annotations.cpp
index a00a449a6d..84cf259b03 100644
--- a/test/api/annotations.cpp
+++ b/test/api/annotations.cpp
@@ -120,6 +120,22 @@ TEST(Annotations, NonImmediateAdd) {
util::write_file("test/output/non_immediate_add.png", renderPNG(map));
}
+TEST(Annotations, Remove) {
+ auto display = std::make_shared<mbgl::HeadlessDisplay>();
+ HeadlessView view(display, 1);
+ DefaultFileSource fileSource(nullptr);
+
+ Map map(view, fileSource, MapMode::Still);
+ map.setStyleJSON(util::read_file("test/fixtures/api/empty.json"), "");
+ uint32_t point = map.addPointAnnotation(PointAnnotation({ 0, 0 }, "default_marker"));
+
+ renderPNG(map);
+
+ map.removeAnnotation(point);
+
+ util::write_file("test/output/remove.png", renderPNG(map));
+}
+
TEST(Annotations, SwitchStyle) {
auto display = std::make_shared<mbgl::HeadlessDisplay>();
HeadlessView view(display, 1);