From 0156ac7c8ce7d22b8a68cc37fcb03b1271ef7a4e Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Mon, 28 Sep 2015 14:14:45 -0700 Subject: [PATCH] Add test for removeAnnotation --- test/api/annotations.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/api/annotations.cpp b/test/api/annotations.cpp index a00a449a6..84cf259b0 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(); + 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(); HeadlessView view(display, 1);