update test data if UPDATE env set

This commit is contained in:
Dane Springmeyer 2016-08-22 10:50:08 -07:00
parent 6613222b84
commit 0ae2f1311c
2 changed files with 5 additions and 3 deletions

@ -1 +1 @@
Subproject commit fb1529e225b36f8a3077ad23f7005951a07c8a7e
Subproject commit ca5716fcef3ed33b319d3047f7d8190bf6ed6081

View file

@ -21,7 +21,7 @@
*****************************************************************************/
#include "catch.hpp"
#include <cstdlib>
#include <mapnik/map.hpp>
#include <mapnik/load_map.hpp>
#include <mapnik/agg_renderer.hpp>
@ -45,8 +45,10 @@ TEST_CASE("ogr") {
mapnik::image_rgba8 im(256,256);
mapnik::agg_renderer<mapnik::image_rgba8> ren(m, im);
ren.apply();
//mapnik::save_to_file(im, "./test/data/images/point_json.png");
std::string filename("./test/data/images/point_json.png");
if (std::getenv("UPDATE") != nullptr) {
mapnik::save_to_file(im, filename);
}
std::unique_ptr<mapnik::image_reader> reader(mapnik::get_image_reader(filename,"png"));
mapnik::image_any data = reader->read(0, 0, reader->width(), reader->height());
mapnik::image_rgba8 expected = mapnik::util::get<mapnik::image_rgba8>(data);