diff --git a/.travis.yml b/.travis.yml index 769aa1911..89bda2eb4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,6 +12,12 @@ env: - secure: "iQYPNpMtejcgYeUkWZGIWz1msIco5qydJrhZTSCQOYahAQerdT7q5WZEpEo3G6IWOGgO1eo7GFuY8DvqQjw1+jC9b9mhkRNdo3LhGTKS9Gsbl5Q27k0rjlaFZmmQHrfPlQJwhfAIp+KLugHtQw5bCoLh+95E3j0F0DayF1tuJ3s=" addons: postgresql: "9.4" + apt: + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-precise-3.6 + packages: + - clang-3.6 cache: directories: @@ -21,32 +27,36 @@ matrix: include: - os: linux compiler: clang - env: JOBS=8 CXX="ccache clang++-3.6 -Qunused-arguments" CC="clang-3.6" MASON_PUBLISH=true + env: JOBS=8 CXX="ccache clang++-3.6 -Qunused-arguments" CC="clang-3.6" MASON_PUBLISH=true BENCH=True addons: apt: sources: [ 'ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.6' ] packages: [ 'clang-3.6', 'libstdc++-4.9-dev', 'libstdc++6' ] - - os: linux - compiler: gcc - env: JOBS=6 CXX="ccache g++-4.9" CC="ccache gcc-4.9" - addons: - apt: - sources: [ 'ubuntu-toolchain-r-test' ] - packages: [ 'gcc-4.9', 'g++-4.9', 'libstdc++-4.9-dev', 'libstdc++6' ] + # OOM killer knocking out build on render_markers_symbolizer.cpp + # + #- os: linux + # compiler: gcc + # env: JOBS=6 CXX="ccache g++-4.9" CC="gcc-4.9" + # addons: + # apt: + # sources: [ 'ubuntu-toolchain-r-test' ] + # packages: [ 'gcc-4.9', 'g++-4.9', 'libstdc++-4.9-dev', 'libstdc++6' ] - os: osx compiler: clang - osx_image: xcode7 # for c++14 support (upgrades clang from 6 -> 7) - env: JOBS=8 MASON_PUBLISH=true + # https://docs.travis-ci.com/user/languages/objective-c/#Supported-OS-X-iOS-SDK-versions + osx_image: xcode7.2 # upgrades clang from 6 -> 7 + env: JOBS=6 MASON_PUBLISH=true HEAVY_JOBS=3 - os: osx compiler: clang - osx_image: xcode7 # for c++14 support (upgrades clang from 6 -> 7) - env: JOBS=8 COVERAGE=true + osx_image: xcode7.2 # upgrades clang from 6 -> 7 + env: JOBS=6 COVERAGE=true HEAVY_JOBS=3 before_install: - export PYTHONUSERBASE=${PYTHONUSERBASE} - export PATH=${PYTHONUSERBASE}/bin:${PATH} - export COVERAGE=${COVERAGE:-false} - export MASON_PUBLISH=${MASON_PUBLISH:-false} + - export BENCH=${BENCH:-false} - if [[ ${TRAVIS_BRANCH} != 'master' ]]; then export MASON_PUBLISH=false; fi - if [[ ${TRAVIS_PULL_REQUEST} != 'false' ]]; then export MASON_PUBLISH=false; fi - git submodule update --init --depth=10 || @@ -79,24 +89,24 @@ install: script: - source bootstrap.sh - if [[ ${COVERAGE} == true ]]; then - ./configure CUSTOM_LDFLAGS='--coverage' CUSTOM_CXXFLAGS='--coverage' CUSTOM_CFLAGS='--coverage' DEBUG=True; + ./configure PGSQL2SQLITE=False SVG2PNG=False SAMPLE_INPUT_PLUGINS=False SVG_RENDERER=False BENCHMARK=${BENCH} CUSTOM_LDFLAGS='--coverage' CUSTOM_CXXFLAGS='--coverage' CUSTOM_CFLAGS='--coverage' DEBUG=True; elif [[ ${MASON_PUBLISH} == true ]]; then export MASON_NAME=mapnik; export MASON_VERSION=latest; export MASON_LIB_FILE=lib/libmapnik-wkt.a; source ./.mason/mason.sh; - ./configure CPP_TESTS=False PREFIX=${MASON_PREFIX} PATH_REPLACE='' MAPNIK_BUNDLED_SHARE_DIRECTORY=True RUNTIME_LINK='static'; + ./configure BENCHMARK=${BENCH} PREFIX=${MASON_PREFIX} PATH_REPLACE='' MAPNIK_BUNDLED_SHARE_DIRECTORY=True RUNTIME_LINK='static'; else - ./configure || cat config.log; + ./configure BENCHMARK=${BENCH}; fi - - make + - SCONSFLAGS='--debug=time' make - make test || TEST_RESULT=$? - if [[ ${COVERAGE} == true ]]; then ./mason_packages/.link/bin/cpp-coveralls --build-root . --gcov-options '\-lp' --exclude mason_packages --exclude .sconf_temp --exclude benchmark --exclude deps --exclude scons --exclude test --exclude demo --exclude docs --exclude fonts --exclude utils > /dev/null; fi - #- if [[ ${COVERAGE} != true ]]; then - # make bench; - # fi + - if [[ ${BENCH} == True ]]; then + make bench; + fi - if [[ ${TEST_RESULT:-0} != 0 ]]; then exit $TEST_RESULT ; fi; - if [[ ${MASON_PUBLISH} == true ]]; then ./mason_latest.sh build; diff --git a/Makefile b/Makefile index df50a147b..0a3e87c12 100755 --- a/Makefile +++ b/Makefile @@ -6,6 +6,10 @@ ifeq ($(JOBS),) JOBS:=1 endif +ifeq ($(HEAVY_JOBS),) + HEAVY_JOBS:=1 +endif + all: mapnik install: @@ -36,8 +40,8 @@ python: python bindings/python/test/visual.py -q src/json/libmapnik-json.a: - # we first build memory intensive files with -j1 - $(PYTHON) scons/scons.py -j1 \ + # we first build memory intensive files with -j$(HEAVY_JOBS) + $(PYTHON) scons/scons.py -j$(HEAVY_JOBS) \ --config=cache --implicit-cache --max-drift=1 \ src/renderer_common/render_group_symbolizer.os \ src/renderer_common/render_markers_symbolizer.os \ diff --git a/deps/mapbox/variant b/deps/mapbox/variant index 7f7c667f8..64596e3aa 160000 --- a/deps/mapbox/variant +++ b/deps/mapbox/variant @@ -1 +1 @@ -Subproject commit 7f7c667f870541c208c07d99a9f2c22dfa1f32de +Subproject commit 64596e3aa2c0f47ab3e74a50c5c49acd5c57f5d5 diff --git a/include/mapnik/feature.hpp b/include/mapnik/feature.hpp index c232075ad..f340c83d6 100644 --- a/include/mapnik/feature.hpp +++ b/include/mapnik/feature.hpp @@ -90,7 +90,7 @@ private: using context_type = context >; using context_ptr = std::shared_ptr; -static const value default_feature_value; +static const value default_feature_value{}; class MAPNIK_DECL feature_impl : private util::noncopyable { diff --git a/include/mapnik/geometry.hpp b/include/mapnik/geometry.hpp index 3766ebf23..7063685d7 100644 --- a/include/mapnik/geometry.hpp +++ b/include/mapnik/geometry.hpp @@ -45,9 +45,6 @@ struct point point(mapnik::coord const& c) : x(c.x), y(c.y) {} - point(point const& other) = default; - point(point && other) noexcept = default; - point & operator=(point const& other) = default; friend inline bool operator== (point const& a, point const& b) { return a.x == b.x && a.y == b.y; @@ -65,12 +62,8 @@ template struct line_string : std::vector > { line_string() = default; - line_string (std::size_t size) + explicit line_string(std::size_t size) : std::vector >(size) {} - line_string (line_string && other) = default ; - line_string& operator=(line_string &&) = default; - line_string (line_string const& ) = default; - line_string& operator=(line_string const&) = default; inline std::size_t num_points() const { return std::vector>::size(); } inline void add_coord(T x, T y) { std::vector>::template emplace_back(x,y);} }; @@ -79,17 +72,12 @@ template struct linear_ring : line_string { linear_ring() = default; - linear_ring(std::size_t size) + explicit linear_ring(std::size_t size) : line_string(size) {} - linear_ring (linear_ring && other) = default ; - linear_ring& operator=(linear_ring &&) = default; linear_ring(line_string && other) - : line_string(other) {} - linear_ring (linear_ring const& ) = default; + : line_string(std::move(other)) {} linear_ring(line_string const& other) : line_string(other) {} - linear_ring& operator=(linear_ring const&) = default; - }; template @@ -102,7 +90,6 @@ struct polygon using rings_container = InteriorRings; rings_container interior_rings; - polygon() = default; inline void set_exterior_ring(linear_ring && ring) { exterior_ring = std::move(ring); diff --git a/include/mapnik/image.hpp b/include/mapnik/image.hpp index 9ebdfc3b2..13b21c856 100644 --- a/include/mapnik/image.hpp +++ b/include/mapnik/image.hpp @@ -54,9 +54,6 @@ template struct image_dimensions { image_dimensions(int width, int height); - image_dimensions(image_dimensions const& other) = default; - image_dimensions(image_dimensions && other) = default; - image_dimensions& operator= (image_dimensions rhs); std::size_t width() const; std::size_t height() const; private: diff --git a/include/mapnik/image_any.hpp b/include/mapnik/image_any.hpp index 735ad8223..8aedf302a 100644 --- a/include/mapnik/image_any.hpp +++ b/include/mapnik/image_any.hpp @@ -55,8 +55,9 @@ struct MAPNIK_DECL image_any : image_base bool painted = false); template - image_any(T && _data) noexcept - : image_base(std::move(_data)) {} + image_any(T && _data) + noexcept(std::is_nothrow_constructible::value) + : image_base(std::forward(_data)) {} unsigned char const* bytes() const; unsigned char* bytes(); diff --git a/include/mapnik/image_impl.hpp b/include/mapnik/image_impl.hpp index 732e7ebe6..c756547b0 100644 --- a/include/mapnik/image_impl.hpp +++ b/include/mapnik/image_impl.hpp @@ -43,14 +43,6 @@ image_dimensions::image_dimensions(int width, int height) if (height < 0 || static_cast(height) > max_size) throw std::runtime_error("Invalid height for image dimensions requested"); } -template -image_dimensions& image_dimensions::operator= (image_dimensions rhs) -{ - std::swap(width_, rhs.width_); - std::swap(height_, rhs.height_); - return *this; -} - template std::size_t image_dimensions::width() const { diff --git a/include/mapnik/image_null.hpp b/include/mapnik/image_null.hpp index 2fc4e32c5..5a698bbc9 100644 --- a/include/mapnik/image_null.hpp +++ b/include/mapnik/image_null.hpp @@ -48,9 +48,6 @@ public: bool /*initialize*/ = true, bool /*premultiplied*/ = false, bool /*painted*/ = false) {} - image(image const&) {} - image(image &&) noexcept {} - image& operator=(image) { return *this; } bool operator==(image const&) const { return true; } bool operator<(image const&) const { return false; } diff --git a/include/mapnik/image_view.hpp b/include/mapnik/image_view.hpp index c2f023a30..846da6691 100644 --- a/include/mapnik/image_view.hpp +++ b/include/mapnik/image_view.hpp @@ -37,11 +37,7 @@ public: static constexpr std::size_t pixel_size = sizeof(pixel_type); image_view(std::size_t x, std::size_t y, std::size_t width, std::size_t height, T const& data); - ~image_view(); - image_view(image_view const& rhs); - image_view(image_view && other) noexcept; - image_view& operator=(image_view rhs) = delete; bool operator==(image_view const& rhs) const; bool operator<(image_view const& rhs) const; diff --git a/include/mapnik/image_view_any.hpp b/include/mapnik/image_view_any.hpp index fbdb80d37..23c9779d8 100644 --- a/include/mapnik/image_view_any.hpp +++ b/include/mapnik/image_view_any.hpp @@ -47,8 +47,9 @@ struct MAPNIK_DECL image_view_any : image_view_base image_view_any() = default; template - image_view_any(T && _data) noexcept - : image_view_base(std::move(_data)) {} + image_view_any(T && data) + noexcept(std::is_nothrow_constructible::value) + : image_view_base(std::forward(data)) {} std::size_t width() const; std::size_t height() const; diff --git a/include/mapnik/image_view_impl.hpp b/include/mapnik/image_view_impl.hpp index 89ae15182..14032042a 100644 --- a/include/mapnik/image_view_impl.hpp +++ b/include/mapnik/image_view_impl.hpp @@ -42,25 +42,6 @@ image_view::image_view(std::size_t x, std::size_t y, std::size_t width, std:: if (y_ + height_ > data_.height()) height_ = data_.height() - y_; } -template -image_view::~image_view() {} - -template -image_view::image_view(image_view const& rhs) - : x_(rhs.x_), - y_(rhs.y_), - width_(rhs.width_), - height_(rhs.height_), - data_(rhs.data_) {} - -template -image_view::image_view(image_view && other) noexcept - : x_(std::move(other.x_)), - y_(std::move(other.y_)), - width_(std::move(other.width_)), - height_(std::move(other.height_)), - data_(std::move(other.data_)) {} - template bool image_view::operator==(image_view const& rhs) const { diff --git a/include/mapnik/marker.hpp b/include/mapnik/marker.hpp index bde8d65a2..8ba117ec3 100644 --- a/include/mapnik/marker.hpp +++ b/include/mapnik/marker.hpp @@ -58,18 +58,12 @@ public: bitmap_data_.set(0xff000000); } - marker_rgba8(image_rgba8 const & data) + explicit marker_rgba8(image_rgba8 const& data) : bitmap_data_(data) {} - marker_rgba8(image_rgba8 && data) + explicit marker_rgba8(image_rgba8 && data) noexcept : bitmap_data_(std::move(data)) {} - marker_rgba8(marker_rgba8 const& rhs) - : bitmap_data_(rhs.bitmap_data_) {} - - marker_rgba8(marker_rgba8 && rhs) noexcept - : bitmap_data_(std::move(rhs.bitmap_data_)) {} - box2d bounding_box() const { std::size_t _width = bitmap_data_.width(); @@ -99,17 +93,11 @@ private: struct marker_svg { public: - marker_svg() { } + marker_svg() = default; - marker_svg(mapnik::svg_path_ptr data) + explicit marker_svg(mapnik::svg_path_ptr data) noexcept : vector_data_(data) {} - marker_svg(marker_svg const& rhs) - : vector_data_(rhs.vector_data_) {} - - marker_svg(marker_svg && rhs) noexcept - : vector_data_(rhs.vector_data_) {} - inline box2d bounding_box() const { return vector_data_->bounding_box(); @@ -140,7 +128,6 @@ private: struct marker_null { - marker_null() = default; public: inline box2d bounding_box() const { @@ -195,8 +182,9 @@ struct marker : marker_base marker() = default; template - marker(T && _data) noexcept - : marker_base(std::move(_data)) {} + marker(T && _data) + noexcept(std::is_nothrow_constructible::value) + : marker_base(std::forward(_data)) {} double width() const { diff --git a/include/mapnik/offset_converter.hpp b/include/mapnik/offset_converter.hpp index ab3a59be5..0f0d1ceb4 100644 --- a/include/mapnik/offset_converter.hpp +++ b/include/mapnik/offset_converter.hpp @@ -269,7 +269,7 @@ private: if (position < -1e-6) return -1; return 0; } - + void displace2(vertex2d & v1, vertex2d const& v0, vertex2d const& v2, double a, double b) const { double sa = offset_ * std::sin(a); @@ -284,14 +284,14 @@ private: double abs_hcasa = std::abs(hcasa); double abs_hsa = std::abs(hsa); double abs_hca = std::abs(hca); - - vertex2d v_tmp(vertex2d::no_init); + + vertex2d v_tmp(vertex2d::no_init); v_tmp.x = v1.x - sa - hca; v_tmp.y = v1.y + ca - hsa; v_tmp.cmd = v1.cmd; - + int same = point_line_position(v0, v2, v_tmp)*point_line_position(v0, v2, v1); - + if (same >= 0 && std::abs(h) < 10) { v1.x = v_tmp.x; @@ -314,14 +314,14 @@ private: v1.y = v1.y + ca - hsa; } else - { + { if (abs_hsaca*abs_hsaca + abs_hcasa*abs_hcasa > abs_offset*abs_offset) { double d = (abs_hsaca*abs_hsaca + abs_hcasa*abs_hcasa); d = d < 1e-6 ? 1. : d; double scale = (abs_offset*abs_offset)/d; v1.x = v1.x + hcasa*scale; - v1.y = v1.y + hsaca*scale; + v1.y = v1.y + hsaca*scale; } else { @@ -331,14 +331,6 @@ private: } } - // Avoid spurious warning from g++ (seen with 4.9) - // around continue_loop not being used. - // This is important to suppress: because of the template - // metaprogramming involved this warning otherwise may be - // repeated so many times as to fill up travis logs to the - // point of failure - #pragma GCC diagnostic push - #include status init_vertices() { if (status_ != initial) // already initialized @@ -489,9 +481,9 @@ private: } start_v2.x = v2.x; start_v2.y = v2.y; - bool continue_loop = true; + vertex2d tmp_prev(vertex2d::no_init); - + while (i < points.size()) { v1 = v2; @@ -522,7 +514,6 @@ private: else if (v2.cmd == SEG_END) { if (!is_polygon) break; - continue_loop = false; v2.x = start_v2.x; v2.y = start_v2.y; } @@ -585,7 +576,7 @@ private: tmp_prev.cmd = v1.cmd; tmp_prev.x = v1.x; tmp_prev.y = v1.y; - + if (v1.cmd == SEG_MOVETO) { if (bulge_steps == 0) @@ -635,7 +626,6 @@ private: // initialization finished return status_ = process; } - #pragma GCC diagnostic pop unsigned output_vertex(double* px, double* py) { diff --git a/include/mapnik/params.hpp b/include/mapnik/params.hpp index fc5928900..a154cf731 100644 --- a/include/mapnik/params.hpp +++ b/include/mapnik/params.hpp @@ -50,7 +50,8 @@ struct value_holder : value_holder_base // perfect forwarding template - value_holder(T && obj) noexcept + value_holder(T && obj) + noexcept(std::is_nothrow_constructible::value) : value_holder_base(std::forward(obj)) {} }; diff --git a/include/mapnik/symbolizer_base.hpp b/include/mapnik/symbolizer_base.hpp index f960752c8..8ac446265 100644 --- a/include/mapnik/symbolizer_base.hpp +++ b/include/mapnik/symbolizer_base.hpp @@ -98,10 +98,8 @@ using value_base_type = util::variant::type(obj)) {} - // move ctor - template - strict_value(T && obj) noexcept - : value_base_type(std::move(obj)) {} + template + strict_value(T && obj) + noexcept(std::is_nothrow_constructible::value) + : value_base_type(std::forward(obj)) + {} }; -} + +} // namespace detail struct MAPNIK_DECL symbolizer_base { diff --git a/include/mapnik/value.hpp b/include/mapnik/value.hpp index 1d7747466..a5bf86fc8 100644 --- a/include/mapnik/value.hpp +++ b/include/mapnik/value.hpp @@ -754,22 +754,36 @@ class value : public value_base friend const value operator%(value const&,value const&); public: - value () noexcept //-- comment out for VC++11 - : value_base(value_null()) {} + value() = default; - value (value const& other) = default; + // conversion from type T is done via a temporary of type U, which + // is determined by mapnik_value_type; + // enable_if< decay != value > is necessary to avoid ill-formed + // recursion in noexcept specifier; and it also prevents using this + // constructor where implicitly-declared copy/move should be used + // (e.g. value(value&)) + template ::value, + detail::mapnik_value_type_decay + >::type::type> + value(T && val) + noexcept(noexcept(U(std::forward(val))) && + std::is_nothrow_constructible::value) + : value_base(U(std::forward(val))) {} - value( value && other) noexcept = default; - - template - value ( T const& val) - : value_base(typename detail::mapnik_value_type::type(val)) {} - - template - value ( T && val) - : value_base(typename detail::mapnik_value_type::type(val)) {} - - value & operator=( value const& other) = default; + template ::value, + detail::mapnik_value_type_decay + >::type::type> + value& operator=(T && val) + noexcept(noexcept(U(std::forward(val))) && + std::is_nothrow_assignable::value) + { + value_base::operator=(U(std::forward(val))); + return *this; + } bool operator==(value const& other) const { diff --git a/include/mapnik/value_hash.hpp b/include/mapnik/value_hash.hpp index 4c12bbe97..c1f1d60fc 100644 --- a/include/mapnik/value_hash.hpp +++ b/include/mapnik/value_hash.hpp @@ -68,7 +68,7 @@ template std::size_t mapnik_hash_value(T const& val) { std::size_t seed = util::apply_visitor(detail::value_hasher(), val); - detail::hash_combine(seed, val.get_type_index()); + detail::hash_combine(seed, val.which()); return seed; } diff --git a/include/mapnik/value_types.hpp b/include/mapnik/value_types.hpp index 83ea7641a..4d508fc79 100644 --- a/include/mapnik/value_types.hpp +++ b/include/mapnik/value_types.hpp @@ -227,6 +227,13 @@ struct mapnik_value_type +using mapnik_value_type_decay = mapnik_value_type::type>; + +template +using is_same_decay = std::is_same::type, + typename std::decay::type>; + } // namespace detail } // namespace mapnik diff --git a/include/mapnik/vertex.hpp b/include/mapnik/vertex.hpp index b05f362a5..2e1d37844 100644 --- a/include/mapnik/vertex.hpp +++ b/include/mapnik/vertex.hpp @@ -61,29 +61,12 @@ struct vertex vertex(coord_type x_,coord_type y_,unsigned cmd_) : x(x_),y(y_),cmd(cmd_) {} - vertex(vertex && rhs) noexcept - : x(std::move(rhs.x)), - y(std::move(rhs.y)), - cmd(std::move(rhs.cmd)) {} - - vertex(vertex const& rhs) - : x(rhs.x), - y(rhs.y), - cmd(rhs.cmd) {} - template vertex(vertex const& rhs) : x(coord_type(rhs.x)), y(coord_type(rhs.y)), cmd(rhs.cmd) {} - - vertex& operator=(vertex rhs) - { - swap(rhs); - return *this; - } - template vertex& operator=(vertex const& rhs) { diff --git a/plugins/input/shape/shape_index_featureset.cpp b/plugins/input/shape/shape_index_featureset.cpp index bb9da6ecb..c4b1918d8 100644 --- a/plugins/input/shape/shape_index_featureset.cpp +++ b/plugins/input/shape/shape_index_featureset.cpp @@ -52,6 +52,9 @@ shape_index_featureset::shape_index_featureset(filterT const& filter, ctx_(std::make_shared()), shape_ptr_(std::move(shape_ptr)), tr_(new mapnik::transcoder(encoding)), + offsets_(), + itr_(), + attr_ids_(), row_limit_(row_limit), count_(0), feature_bbox_() @@ -87,12 +90,11 @@ feature_ptr shape_index_featureset::next() int offset = itr_->offset; shape_ptr_->move_to(offset); std::vector> parts; - while (itr_->offset == offset && itr_ != offsets_.end()) + while (itr_ != offsets_.end() && itr_->offset == offset) { if (itr_->start!= -1) parts.emplace_back(itr_->start, itr_->end); ++itr_; } - //std::cerr << "PARTS SIZE=" << parts.size() <<" offset=" << offset << std::endl; mapnik::value_integer feature_id = shape_ptr_->id(); shape_file::record_type record(shape_ptr_->reclength_ * 2); shape_ptr_->shp().read_record(record); diff --git a/src/renderer_common/render_markers_symbolizer.cpp b/src/renderer_common/render_markers_symbolizer.cpp index 7864d3bef..12da737e5 100644 --- a/src/renderer_common/render_markers_symbolizer.cpp +++ b/src/renderer_common/render_markers_symbolizer.cpp @@ -256,13 +256,13 @@ markers_dispatch_params::markers_dispatch_params(box2d const& size, double scale, bool snap) : placement_params{ - .size = size, - .tr = tr, - .spacing = get(sym, feature, vars), - .max_error = get(sym, feature, vars), - .allow_overlap = get(sym, feature, vars), - .avoid_edges = get(sym, feature, vars), - .direction = get(sym, feature, vars)} + size, + tr, + get(sym, feature, vars), + get(sym, feature, vars), + get(sym, feature, vars), + get(sym, feature, vars), + get(sym, feature, vars)} , placement_method(get(sym, feature, vars)) , ignore_placement(get(sym, feature, vars)) , snap_to_pixels(snap) diff --git a/test/unit/datasource/shapeindex.cpp b/test/unit/datasource/shapeindex.cpp index 636713feb..7b3aef029 100644 --- a/test/unit/datasource/shapeindex.cpp +++ b/test/unit/datasource/shapeindex.cpp @@ -39,6 +39,7 @@ std::size_t count_shapefile_features(std::string const& filename) params["type"] = "shape"; params["file"] = filename; auto ds = mapnik::datasource_cache::instance().create(params); + REQUIRE(ds != nullptr); CHECK(ds->type() == mapnik::datasource::datasource_t::Vector); auto fields = ds->get_descriptor().get_descriptors(); mapnik::query query(ds->envelope()); @@ -47,6 +48,7 @@ std::size_t count_shapefile_features(std::string const& filename) query.add_property_name(field.get_name()); } auto features = ds->features(query); + REQUIRE(features != nullptr); std::size_t feature_count = 0; auto feature = features->next();