restore compile of map_request_test (asserts still disabled - refs #2575)
This commit is contained in:
parent
acb3bb0821
commit
96cff81f57
1 changed files with 22 additions and 15 deletions
|
@ -15,6 +15,8 @@
|
||||||
#include <mapnik/image_reader.hpp>
|
#include <mapnik/image_reader.hpp>
|
||||||
#include <mapnik/scale_denominator.hpp>
|
#include <mapnik/scale_denominator.hpp>
|
||||||
#include <mapnik/feature_style_processor.hpp>
|
#include <mapnik/feature_style_processor.hpp>
|
||||||
|
#include <mapnik/projection.hpp>
|
||||||
|
#include <mapnik/layer.hpp>
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
@ -65,9 +67,6 @@ int main(int argc, char** argv)
|
||||||
args.push_back(argv[i]);
|
args.push_back(argv[i]);
|
||||||
}
|
}
|
||||||
bool quiet = std::find(args.begin(), args.end(), "-q")!=args.end();
|
bool quiet = std::find(args.begin(), args.end(), "-q")!=args.end();
|
||||||
// TODO - re-enable if we can control the freetype/cairo versions used
|
|
||||||
// https://github.com/mapnik/mapnik/issues/1868
|
|
||||||
/*
|
|
||||||
std::string expected("./tests/cpp_tests/support/map-request-marker-text-line-expected.png");
|
std::string expected("./tests/cpp_tests/support/map-request-marker-text-line-expected.png");
|
||||||
std::string expected_cairo("./tests/cpp_tests/support/map-request-marker-text-line-expected-cairo.png");
|
std::string expected_cairo("./tests/cpp_tests/support/map-request-marker-text-line-expected-cairo.png");
|
||||||
try {
|
try {
|
||||||
|
@ -86,9 +85,11 @@ int main(int argc, char** argv)
|
||||||
mapnik::agg_renderer<mapnik::image_32> renderer1(m,im,scale_factor);
|
mapnik::agg_renderer<mapnik::image_32> renderer1(m,im,scale_factor);
|
||||||
renderer1.apply();
|
renderer1.apply();
|
||||||
std::string actual1("/tmp/map-request-marker-text-line-actual1.png");
|
std::string actual1("/tmp/map-request-marker-text-line-actual1.png");
|
||||||
//mapnik::save_to_file(im,expected);
|
//mapnik::save_to_file(im.data(),expected);
|
||||||
mapnik::save_to_file(im,actual1);
|
mapnik::save_to_file(im.data(),actual1);
|
||||||
BOOST_TEST(compare_images(actual1,expected));
|
// TODO - re-enable if we can control the freetype/cairo versions used
|
||||||
|
// https://github.com/mapnik/mapnik/issues/1868
|
||||||
|
//BOOST_TEST(compare_images(actual1,expected));
|
||||||
|
|
||||||
// reset image
|
// reset image
|
||||||
im.clear();
|
im.clear();
|
||||||
|
@ -98,17 +99,20 @@ int main(int argc, char** argv)
|
||||||
req.set_buffer_size(m.buffer_size());
|
req.set_buffer_size(m.buffer_size());
|
||||||
|
|
||||||
// render using apply() and mapnik::request
|
// render using apply() and mapnik::request
|
||||||
mapnik::agg_renderer<mapnik::image_32> renderer2(m,req,im,scale_factor);
|
mapnik::attributes vars;
|
||||||
|
mapnik::agg_renderer<mapnik::image_32> renderer2(m,req,vars,im,scale_factor);
|
||||||
renderer2.apply();
|
renderer2.apply();
|
||||||
std::string actual2("/tmp/map-request-marker-text-line-actual2.png");
|
std::string actual2("/tmp/map-request-marker-text-line-actual2.png");
|
||||||
mapnik::save_to_file(im,actual2);
|
mapnik::save_to_file(im.data(),actual2);
|
||||||
BOOST_TEST(compare_images(actual2,expected));
|
// TODO - re-enable if we can control the freetype/cairo versions used
|
||||||
|
// https://github.com/mapnik/mapnik/issues/1868
|
||||||
|
//BOOST_TEST(compare_images(actual2,expected));
|
||||||
|
|
||||||
// reset image
|
// reset image
|
||||||
im.clear();
|
im.clear();
|
||||||
|
|
||||||
// render with apply_to_layer api and mapnik::request params passed to apply_to_layer
|
// render with apply_to_layer api and mapnik::request params passed to apply_to_layer
|
||||||
mapnik::agg_renderer<mapnik::image_32> renderer3(m,req,im,scale_factor);
|
mapnik::agg_renderer<mapnik::image_32> renderer3(m,req,vars,im,scale_factor);
|
||||||
renderer3.start_map_processing(m);
|
renderer3.start_map_processing(m);
|
||||||
mapnik::projection map_proj(m.srs(),true);
|
mapnik::projection map_proj(m.srs(),true);
|
||||||
double scale_denom = mapnik::scale_denominator(req.scale(),map_proj.is_geographic());
|
double scale_denom = mapnik::scale_denominator(req.scale(),map_proj.is_geographic());
|
||||||
|
@ -133,8 +137,10 @@ int main(int argc, char** argv)
|
||||||
}
|
}
|
||||||
renderer3.end_map_processing(m);
|
renderer3.end_map_processing(m);
|
||||||
std::string actual3("/tmp/map-request-marker-text-line-actual3.png");
|
std::string actual3("/tmp/map-request-marker-text-line-actual3.png");
|
||||||
mapnik::save_to_file(im,actual3);
|
mapnik::save_to_file(im.data(),actual3);
|
||||||
BOOST_TEST(compare_images(actual3,expected));
|
// TODO - re-enable if we can control the freetype/cairo versions used
|
||||||
|
// https://github.com/mapnik/mapnik/issues/1868
|
||||||
|
//BOOST_TEST(compare_images(actual3,expected));
|
||||||
|
|
||||||
// also test cairo
|
// also test cairo
|
||||||
#if defined(HAVE_CAIRO)
|
#if defined(HAVE_CAIRO)
|
||||||
|
@ -142,19 +148,20 @@ int main(int argc, char** argv)
|
||||||
cairo_image_surface_create(CAIRO_FORMAT_ARGB32,req.width(),req.height()),
|
cairo_image_surface_create(CAIRO_FORMAT_ARGB32,req.width(),req.height()),
|
||||||
mapnik::cairo_surface_closer());
|
mapnik::cairo_surface_closer());
|
||||||
mapnik::cairo_ptr image_context = (mapnik::create_context(image_surface));
|
mapnik::cairo_ptr image_context = (mapnik::create_context(image_surface));
|
||||||
mapnik::cairo_renderer<mapnik::cairo_ptr> png_render(m,req,image_context,scale_factor);
|
mapnik::cairo_renderer<mapnik::cairo_ptr> png_render(m,req,vars,image_context,scale_factor);
|
||||||
png_render.apply();
|
png_render.apply();
|
||||||
//cairo_surface_write_to_png(&*image_surface, expected_cairo.c_str());
|
//cairo_surface_write_to_png(&*image_surface, expected_cairo.c_str());
|
||||||
std::string actual_cairo("/tmp/map-request-marker-text-line-actual4.png");
|
std::string actual_cairo("/tmp/map-request-marker-text-line-actual4.png");
|
||||||
cairo_surface_write_to_png(&*image_surface, actual_cairo.c_str());
|
cairo_surface_write_to_png(&*image_surface, actual_cairo.c_str());
|
||||||
BOOST_TEST(compare_images(actual_cairo,expected_cairo));
|
// TODO - re-enable if we can control the freetype/cairo versions used
|
||||||
|
// https://github.com/mapnik/mapnik/issues/1868
|
||||||
|
//BOOST_TEST(compare_images(actual_cairo,expected_cairo));
|
||||||
#endif
|
#endif
|
||||||
// TODO - test grid_renderer
|
// TODO - test grid_renderer
|
||||||
|
|
||||||
} catch (std::exception const& ex) {
|
} catch (std::exception const& ex) {
|
||||||
std::clog << ex.what() << "\n";
|
std::clog << ex.what() << "\n";
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
if (!::boost::detail::test_errors()) {
|
if (!::boost::detail::test_errors()) {
|
||||||
if (quiet) std::clog << "\x1b[1;32m.\x1b[0m";
|
if (quiet) std::clog << "\x1b[1;32m.\x1b[0m";
|
||||||
else std::clog << "C++ Map Request rendering hook: \x1b[1;32m✓ \x1b[0m\n";
|
else std::clog << "C++ Map Request rendering hook: \x1b[1;32m✓ \x1b[0m\n";
|
||||||
|
|
Loading…
Reference in a new issue