From 96cff81f57db2b91e30218cea5154974b06a1be5 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Thu, 8 Jan 2015 13:52:55 -0800 Subject: [PATCH] restore compile of map_request_test (asserts still disabled - refs #2575) --- tests/cpp_tests/map_request_test.cpp | 37 +++++++++++++++++----------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/tests/cpp_tests/map_request_test.cpp b/tests/cpp_tests/map_request_test.cpp index d98819754..b7f2deb64 100644 --- a/tests/cpp_tests/map_request_test.cpp +++ b/tests/cpp_tests/map_request_test.cpp @@ -15,6 +15,8 @@ #include #include #include +#include +#include #include #include @@ -65,9 +67,6 @@ int main(int argc, char** argv) args.push_back(argv[i]); } 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_cairo("./tests/cpp_tests/support/map-request-marker-text-line-expected-cairo.png"); try { @@ -86,9 +85,11 @@ int main(int argc, char** argv) mapnik::agg_renderer renderer1(m,im,scale_factor); renderer1.apply(); std::string actual1("/tmp/map-request-marker-text-line-actual1.png"); - //mapnik::save_to_file(im,expected); - mapnik::save_to_file(im,actual1); - BOOST_TEST(compare_images(actual1,expected)); + //mapnik::save_to_file(im.data(),expected); + mapnik::save_to_file(im.data(),actual1); + // 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 im.clear(); @@ -98,17 +99,20 @@ int main(int argc, char** argv) req.set_buffer_size(m.buffer_size()); // render using apply() and mapnik::request - mapnik::agg_renderer renderer2(m,req,im,scale_factor); + mapnik::attributes vars; + mapnik::agg_renderer renderer2(m,req,vars,im,scale_factor); renderer2.apply(); std::string actual2("/tmp/map-request-marker-text-line-actual2.png"); - mapnik::save_to_file(im,actual2); - BOOST_TEST(compare_images(actual2,expected)); + mapnik::save_to_file(im.data(),actual2); + // 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 im.clear(); // render with apply_to_layer api and mapnik::request params passed to apply_to_layer - mapnik::agg_renderer renderer3(m,req,im,scale_factor); + mapnik::agg_renderer renderer3(m,req,vars,im,scale_factor); renderer3.start_map_processing(m); mapnik::projection map_proj(m.srs(),true); 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); std::string actual3("/tmp/map-request-marker-text-line-actual3.png"); - mapnik::save_to_file(im,actual3); - BOOST_TEST(compare_images(actual3,expected)); + mapnik::save_to_file(im.data(),actual3); + // 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 #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()), mapnik::cairo_surface_closer()); mapnik::cairo_ptr image_context = (mapnik::create_context(image_surface)); - mapnik::cairo_renderer png_render(m,req,image_context,scale_factor); + mapnik::cairo_renderer png_render(m,req,vars,image_context,scale_factor); png_render.apply(); //cairo_surface_write_to_png(&*image_surface, expected_cairo.c_str()); std::string actual_cairo("/tmp/map-request-marker-text-line-actual4.png"); 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 // TODO - test grid_renderer } catch (std::exception const& ex) { std::clog << ex.what() << "\n"; } - */ if (!::boost::detail::test_errors()) { if (quiet) std::clog << "\x1b[1;32m.\x1b[0m"; else std::clog << "C++ Map Request rendering hook: \x1b[1;32m✓ \x1b[0m\n";