update pre-commit and format sources
This commit is contained in:
parent
7ef431ece2
commit
ab626ac052
39 changed files with 280 additions and 412 deletions
|
@ -2,7 +2,7 @@
|
|||
# See https://pre-commit.com/hooks.html for more hooks
|
||||
repos:
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v4.3.0
|
||||
rev: v4.6.0
|
||||
hooks:
|
||||
- id: trailing-whitespace
|
||||
files: ^.*\.cmake|CMakeLists\.txt$
|
||||
|
@ -10,7 +10,7 @@ repos:
|
|||
files: ^.*\.cmake|CMakeLists\.txt$
|
||||
|
||||
- repo: https://github.com/pre-commit/mirrors-clang-format
|
||||
rev: v14.0.6
|
||||
rev: v18.1.3
|
||||
hooks:
|
||||
- id: clang-format
|
||||
types_or: [c++, c]
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
// mapnik
|
||||
|
||||
#ifndef Q_MOC_RUN // QT moc chokes on BOOST_JOIN
|
||||
//#include <mapnik/config_error.hpp>
|
||||
// #include <mapnik/config_error.hpp>
|
||||
#include <mapnik/load_map.hpp>
|
||||
#include <mapnik/save_map.hpp>
|
||||
#include <mapnik/projection.hpp>
|
||||
|
|
|
@ -96,10 +96,7 @@ class MAPNIK_DECL logger : public singleton<logger, CreateStatic>,
|
|||
}
|
||||
|
||||
// format
|
||||
static std::string const& get_format()
|
||||
{
|
||||
return format_;
|
||||
}
|
||||
static std::string const& get_format() { return format_; }
|
||||
|
||||
static void set_format(std::string const& format)
|
||||
{
|
||||
|
@ -211,10 +208,7 @@ class base_log : public util::noncopyable
|
|||
|
||||
private:
|
||||
#ifdef MAPNIK_LOG
|
||||
inline bool check_severity()
|
||||
{
|
||||
return Severity >= logger::get_object_severity(object_name_);
|
||||
}
|
||||
inline bool check_severity() { return Severity >= logger::get_object_severity(object_name_); }
|
||||
|
||||
typename output_policy::stream_buffer streambuf_;
|
||||
std::string object_name_;
|
||||
|
|
|
@ -134,13 +134,13 @@ struct MAPNIK_DECL enumeration
|
|||
std::map<enum_class, std::string> fnc_name##_lookup() \
|
||||
{ \
|
||||
std::map<enum_class, std::string> val_map; \
|
||||
std::transform( \
|
||||
fnc_name##_map.begin(), \
|
||||
fnc_name##_map.end(), \
|
||||
std::inserter(val_map, val_map.end()), \
|
||||
[](const mapnik::detail::EnumStringT<enum_class>& val) { \
|
||||
return std::pair<enum_class, std::string>{std::get<0>(val), std::string{std::get<1>(val).data()}}; \
|
||||
}); \
|
||||
std::transform(fnc_name##_map.begin(), \
|
||||
fnc_name##_map.end(), \
|
||||
std::inserter(val_map, val_map.end()), \
|
||||
[](const mapnik::detail::EnumStringT<enum_class>& val) { \
|
||||
return std::pair<enum_class, std::string>{std::get<0>(val), \
|
||||
std::string{std::get<1>(val).data()}}; \
|
||||
}); \
|
||||
return val_map; \
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#include <mapnik/value/types.hpp>
|
||||
|
||||
// boost
|
||||
//#include <boost/pool/pool_alloc.hpp>
|
||||
// #include <boost/pool/pool_alloc.hpp>
|
||||
|
||||
namespace mapnik {
|
||||
struct feature_factory
|
||||
|
|
|
@ -152,10 +152,7 @@ class hextree : private util::noncopyable
|
|||
|
||||
~hextree() {}
|
||||
|
||||
void setMaxColors(unsigned max_colors)
|
||||
{
|
||||
max_colors_ = max_colors;
|
||||
}
|
||||
void setMaxColors(unsigned max_colors) { max_colors_ = max_colors; }
|
||||
|
||||
void setGamma(double g)
|
||||
{
|
||||
|
@ -166,15 +163,9 @@ class hextree : private util::noncopyable
|
|||
}
|
||||
}
|
||||
|
||||
void setTransMode(unsigned t)
|
||||
{
|
||||
trans_mode_ = t;
|
||||
}
|
||||
void setTransMode(unsigned t) { trans_mode_ = t; }
|
||||
|
||||
transparency_mode_t getTransMode() const
|
||||
{
|
||||
return trans_mode_;
|
||||
}
|
||||
transparency_mode_t getTransMode() const { return trans_mode_; }
|
||||
|
||||
// process alpha value based on trans_mode_
|
||||
std::uint8_t preprocessAlpha(std::uint8_t a) const
|
||||
|
|
|
@ -561,15 +561,13 @@ struct offset_converter
|
|||
if (bulge_steps == 0)
|
||||
{
|
||||
// inside turn (sharp/obtuse angle)
|
||||
MAPNIK_LOG_DEBUG(ctrans) << "offset_converter:"
|
||||
<< " Sharp joint [<< inside turn "
|
||||
MAPNIK_LOG_DEBUG(ctrans) << "offset_converter:" << " Sharp joint [<< inside turn "
|
||||
<< static_cast<int>(util::degrees(joint_angle)) << " degrees >>]";
|
||||
}
|
||||
else
|
||||
{
|
||||
// outside turn (reflex angle)
|
||||
MAPNIK_LOG_DEBUG(ctrans) << "offset_converter:"
|
||||
<< " Bulge joint >)) outside turn "
|
||||
MAPNIK_LOG_DEBUG(ctrans) << "offset_converter:" << " Bulge joint >)) outside turn "
|
||||
<< static_cast<int>(util::degrees(joint_angle)) << " degrees ((< with "
|
||||
<< bulge_steps << " segments";
|
||||
}
|
||||
|
@ -640,10 +638,7 @@ struct offset_converter
|
|||
return cur_.cmd;
|
||||
}
|
||||
|
||||
void push_vertex(vertex2d const& v)
|
||||
{
|
||||
vertices_.push_back(v);
|
||||
}
|
||||
void push_vertex(vertex2d const& v) { vertices_.push_back(v); }
|
||||
|
||||
Geometry& geom_;
|
||||
double offset_;
|
||||
|
|
|
@ -46,7 +46,7 @@ MAPNIK_DISABLE_WARNING_POP
|
|||
#include <vector>
|
||||
#include <tuple>
|
||||
|
||||
#define U2RED(x) ((x)&0xff)
|
||||
#define U2RED(x) ((x) & 0xff)
|
||||
#define U2GREEN(x) (((x) >> 8) & 0xff)
|
||||
#define U2BLUE(x) (((x) >> 16) & 0xff)
|
||||
#define U2ALPHA(x) (((x) >> 24) & 0xff)
|
||||
|
|
|
@ -75,18 +75,18 @@ class MAPNIK_DECL parameters : public param_map
|
|||
#ifdef _MSC_VER
|
||||
template MAPNIK_DECL std::optional<std::string> parameters::get(std::string const& key) const;
|
||||
template MAPNIK_DECL std::optional<std::string> parameters::get(std::string const& key,
|
||||
std::string const& default_opt_value) const;
|
||||
std::string const& default_opt_value) const;
|
||||
template MAPNIK_DECL std::optional<value_double> parameters::get(std::string const& key) const;
|
||||
template MAPNIK_DECL std::optional<value_double> parameters::get(std::string const& key,
|
||||
value_double const& default_opt_value) const;
|
||||
value_double const& default_opt_value) const;
|
||||
|
||||
template MAPNIK_DECL std::optional<value_integer> parameters::get(std::string const& key) const;
|
||||
template MAPNIK_DECL std::optional<value_integer> parameters::get(std::string const& key,
|
||||
value_integer const& default_opt_value) const;
|
||||
value_integer const& default_opt_value) const;
|
||||
|
||||
template MAPNIK_DECL std::optional<value_bool> parameters::get(std::string const& key) const;
|
||||
template MAPNIK_DECL std::optional<value_bool> parameters::get(std::string const& key,
|
||||
value_bool const& default_opt_value) const;
|
||||
value_bool const& default_opt_value) const;
|
||||
|
||||
template MAPNIK_DECL std::optional<mapnik::boolean_type> parameters::get(std::string const& key) const;
|
||||
template MAPNIK_DECL std::optional<mapnik::boolean_type>
|
||||
|
|
|
@ -72,10 +72,7 @@ struct extract_value<value_bool>
|
|||
return std::nullopt;
|
||||
}
|
||||
|
||||
static inline std::optional<value_bool> do_extract_from_bool(value_bool const& source)
|
||||
{
|
||||
return source;
|
||||
}
|
||||
static inline std::optional<value_bool> do_extract_from_bool(value_bool const& source) { return source; }
|
||||
};
|
||||
|
||||
template<>
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#include <emmintrin.h>
|
||||
#include <xmmintrin.h>
|
||||
|
||||
#define ROUND_DOWN(x, s) ((x) & ~((s)-1))
|
||||
#define ROUND_DOWN(x, s) ((x) & ~((s) - 1))
|
||||
|
||||
typedef union {
|
||||
__m128i v;
|
||||
|
|
|
@ -613,15 +613,9 @@ class renderer_agg : util::noncopyable
|
|||
}
|
||||
#endif
|
||||
|
||||
inline VertexSource& source() const
|
||||
{
|
||||
return source_;
|
||||
}
|
||||
inline VertexSource& source() const { return source_; }
|
||||
|
||||
inline group const& svg_group() const
|
||||
{
|
||||
return svg_group_;
|
||||
}
|
||||
inline group const& svg_group() const { return svg_group_; }
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
@ -464,8 +464,7 @@ struct set_symbolizer_property_impl<Symbolizer, T, true>
|
|||
const auto [result_value, is_evaluated] = pre_evaluate_expression<value>(*val);
|
||||
if (is_evaluated)
|
||||
{
|
||||
const auto enum_val2 =
|
||||
detail::enum_traits<value_type>::from_string(result_value.to_string());
|
||||
const auto enum_val2 = detail::enum_traits<value_type>::from_string(result_value.to_string());
|
||||
if (enum_val2)
|
||||
{
|
||||
put(sym, key, *enum_val);
|
||||
|
|
|
@ -60,25 +60,13 @@ class file : public util::noncopyable
|
|||
}
|
||||
}
|
||||
|
||||
inline bool is_open() const
|
||||
{
|
||||
return file_ ? true : false;
|
||||
}
|
||||
inline bool is_open() const { return file_ ? true : false; }
|
||||
|
||||
explicit operator bool() const
|
||||
{
|
||||
return this->is_open();
|
||||
}
|
||||
explicit operator bool() const { return this->is_open(); }
|
||||
|
||||
inline std::FILE* get() const
|
||||
{
|
||||
return file_.get();
|
||||
}
|
||||
inline std::FILE* get() const { return file_.get(); }
|
||||
|
||||
inline std::size_t size() const
|
||||
{
|
||||
return size_;
|
||||
}
|
||||
inline std::size_t size() const { return size_; }
|
||||
|
||||
inline data_type data() const
|
||||
{
|
||||
|
|
|
@ -77,10 +77,7 @@ class singleton
|
|||
singleton(const singleton& rhs);
|
||||
singleton& operator=(const singleton&);
|
||||
|
||||
static void onDeadReference()
|
||||
{
|
||||
throw std::runtime_error("dead reference!");
|
||||
}
|
||||
static void onDeadReference() { throw std::runtime_error("dead reference!"); }
|
||||
|
||||
static void DestroySingleton()
|
||||
{
|
||||
|
|
|
@ -37,6 +37,6 @@
|
|||
|
||||
#define MAPNIK_VERSION_AT_LEAST(major, minor, patch) (MAPNIK_VERSION >= MAPNIK_VERSION_ENCODE(major, minor, patch))
|
||||
|
||||
#define MAPNIK_VERSION_ENCODE(major, minor, patch) ((major)*100000 + (minor)*100 + (patch))
|
||||
#define MAPNIK_VERSION_ENCODE(major, minor, patch) ((major) * 100000 + (minor) * 100 + (patch))
|
||||
|
||||
#endif // MAPNIK_VERSION_HPP
|
||||
|
|
|
@ -47,7 +47,6 @@ MAPNIK_DISABLE_WARNING_POP
|
|||
#include <iosfwd>
|
||||
#include <string>
|
||||
|
||||
|
||||
template<std::size_t Max, std::size_t Min>
|
||||
struct csv_linear : boost::geometry::index::linear<Max, Min>
|
||||
{};
|
||||
|
|
|
@ -404,8 +404,8 @@ struct geobuf : util::noncopyable
|
|||
}
|
||||
|
||||
template<typename T>
|
||||
geometry::multi_line_string<double>
|
||||
read_multi_linestring(T& reader, std::optional<std::vector<std::uint32_t>> const& lengths)
|
||||
geometry::multi_line_string<double> read_multi_linestring(T& reader,
|
||||
std::optional<std::vector<std::uint32_t>> const& lengths)
|
||||
{
|
||||
geometry::multi_line_string<double> multi_line;
|
||||
multi_line.reserve(!lengths ? 1 : lengths->size());
|
||||
|
|
|
@ -139,20 +139,11 @@ class ogr_layer_ptr
|
|||
#endif
|
||||
}
|
||||
|
||||
std::string const& layer_name() const
|
||||
{
|
||||
return layer_name_;
|
||||
}
|
||||
std::string const& layer_name() const { return layer_name_; }
|
||||
|
||||
OGRLayer* layer() const
|
||||
{
|
||||
return layer_;
|
||||
}
|
||||
OGRLayer* layer() const { return layer_; }
|
||||
|
||||
bool is_valid() const
|
||||
{
|
||||
return is_valid_;
|
||||
}
|
||||
bool is_valid() const { return is_valid_; }
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
@ -160,10 +160,10 @@ typedef enum {
|
|||
#define BANDTYPE_FLAG_RESERVED3 (1 << 4)
|
||||
|
||||
#define BANDTYPE_PIXTYPE_MASK 0x0F
|
||||
#define BANDTYPE_PIXTYPE(x) ((x)&BANDTYPE_PIXTYPE_MASK)
|
||||
#define BANDTYPE_IS_OFFDB(x) ((x)&BANDTYPE_FLAG_OFFDB)
|
||||
#define BANDTYPE_HAS_NODATA(x) ((x)&BANDTYPE_FLAG_HASNODATA)
|
||||
#define BANDTYPE_IS_NODATA(x) ((x)&BANDTYPE_FLAG_ISNODATA)
|
||||
#define BANDTYPE_PIXTYPE(x) ((x) & BANDTYPE_PIXTYPE_MASK)
|
||||
#define BANDTYPE_IS_OFFDB(x) ((x) & BANDTYPE_FLAG_OFFDB)
|
||||
#define BANDTYPE_HAS_NODATA(x) ((x) & BANDTYPE_FLAG_HASNODATA)
|
||||
#define BANDTYPE_IS_NODATA(x) ((x) & BANDTYPE_FLAG_ISNODATA)
|
||||
|
||||
} // namespace
|
||||
|
||||
|
|
|
@ -236,20 +236,11 @@ class Connection
|
|||
return std::make_shared<ResultSet>(result);
|
||||
}
|
||||
|
||||
std::string client_encoding() const
|
||||
{
|
||||
return PQparameterStatus(conn_, "client_encoding");
|
||||
}
|
||||
std::string client_encoding() const { return PQparameterStatus(conn_, "client_encoding"); }
|
||||
|
||||
bool isOK() const
|
||||
{
|
||||
return (!closed_) && (PQstatus(conn_) != CONNECTION_BAD);
|
||||
}
|
||||
bool isOK() const { return (!closed_) && (PQstatus(conn_) != CONNECTION_BAD); }
|
||||
|
||||
bool isPending() const
|
||||
{
|
||||
return pending_;
|
||||
}
|
||||
bool isPending() const { return pending_; }
|
||||
|
||||
void close()
|
||||
{
|
||||
|
|
|
@ -171,30 +171,15 @@ class shape_file : public mapnik::util::mapped_memory_file
|
|||
file_.read(reinterpret_cast<char*>(&envelope), sizeof(envelope));
|
||||
}
|
||||
|
||||
inline void rewind()
|
||||
{
|
||||
seek(100);
|
||||
}
|
||||
inline void rewind() { seek(100); }
|
||||
|
||||
inline void seek(std::streampos pos)
|
||||
{
|
||||
file_.seekg(pos, std::ios::beg);
|
||||
}
|
||||
inline void seek(std::streampos pos) { file_.seekg(pos, std::ios::beg); }
|
||||
|
||||
inline std::streampos pos()
|
||||
{
|
||||
return file_.tellg();
|
||||
}
|
||||
inline std::streampos pos() { return file_.tellg(); }
|
||||
|
||||
inline bool is_eof()
|
||||
{
|
||||
return file_.eof();
|
||||
}
|
||||
inline bool is_eof() { return file_.eof(); }
|
||||
|
||||
inline bool is_good()
|
||||
{
|
||||
return file_.good();
|
||||
}
|
||||
inline bool is_good() { return file_.good(); }
|
||||
};
|
||||
|
||||
#endif // SHAPEFILE_HPP
|
||||
|
|
|
@ -115,8 +115,7 @@ class sqlite_connection
|
|||
s << "'" << sqlite3_errmsg(db_) << "'";
|
||||
else
|
||||
s << "unknown error, lost connection";
|
||||
s << " (" << file_ << ")"
|
||||
<< "\nFull sql was: '" << sql << "'";
|
||||
s << " (" << file_ << ")" << "\nFull sql was: '" << sql << "'";
|
||||
|
||||
throw mapnik::datasource_exception(s.str());
|
||||
}
|
||||
|
@ -160,10 +159,7 @@ class sqlite_connection
|
|||
return rc;
|
||||
}
|
||||
|
||||
sqlite3* operator*()
|
||||
{
|
||||
return db_;
|
||||
}
|
||||
sqlite3* operator*() { return db_; }
|
||||
|
||||
bool load_extension(std::string const& ext_path)
|
||||
{
|
||||
|
|
|
@ -260,9 +260,8 @@ sqlite_datasource::sqlite_datasource(parameters const& params)
|
|||
if (geometry_field_.empty())
|
||||
{
|
||||
std::ostringstream s;
|
||||
s << "Sqlite Plugin: unable to detect the column "
|
||||
<< "containing a valid geometry on table '" << geometry_table_ << "'. "
|
||||
<< "Please provide a column name by passing the 'geometry_field' option "
|
||||
s << "Sqlite Plugin: unable to detect the column " << "containing a valid geometry on table '"
|
||||
<< geometry_table_ << "'. " << "Please provide a column name by passing the 'geometry_field' option "
|
||||
<< "or indicate a different spatial table to use by passing the 'geometry_table' option";
|
||||
throw datasource_exception(s.str());
|
||||
}
|
||||
|
@ -316,12 +315,9 @@ sqlite_datasource::sqlite_datasource(parameters const& params)
|
|||
else
|
||||
{
|
||||
std::ostringstream s;
|
||||
s << "Sqlite Plugin: could not generate spatial index"
|
||||
<< " for table '" << geometry_table_ << "'"
|
||||
<< " as no primary key can be detected."
|
||||
<< " You should either declare an INTEGER PRIMARY KEY"
|
||||
<< " or set the 'key_field' option to force a"
|
||||
<< " given field to be used as the primary key";
|
||||
s << "Sqlite Plugin: could not generate spatial index" << " for table '" << geometry_table_ << "'"
|
||||
<< " as no primary key can be detected." << " You should either declare an INTEGER PRIMARY KEY"
|
||||
<< " or set the 'key_field' option to force a" << " given field to be used as the primary key";
|
||||
throw datasource_exception(s.str());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -144,6 +144,7 @@ class sqlite_utils
|
|||
static void get_tables(std::shared_ptr<sqlite_connection> ds, std::vector<std::string>& tables)
|
||||
{
|
||||
std::ostringstream sql;
|
||||
// clang-format off
|
||||
// todo handle finding tables from attached db's
|
||||
sql << " SELECT name FROM sqlite_master"
|
||||
<< " WHERE type IN ('table','view')"
|
||||
|
@ -155,6 +156,7 @@ class sqlite_utils
|
|||
<< " SELECT name FROM sqlite_temp_master"
|
||||
<< " WHERE type IN ('table','view')"
|
||||
<< " ORDER BY 1";
|
||||
// clang-format on
|
||||
sqlite3_stmt* stmt = 0;
|
||||
const int rc = sqlite3_prepare_v2(*(*ds), sql.str().c_str(), -1, &stmt, 0);
|
||||
if (rc == SQLITE_OK)
|
||||
|
@ -352,8 +354,7 @@ class sqlite_utils
|
|||
{
|
||||
std::ostringstream error_msg;
|
||||
error_msg << "Sqlite Plugin: invalid type for key field '" << rs->column_name(1)
|
||||
<< "' when creating index "
|
||||
<< "type was: " << type_oid << "";
|
||||
<< "' when creating index " << "type was: " << type_oid << "";
|
||||
throw mapnik::datasource_exception(error_msg.str());
|
||||
}
|
||||
const sqlite_int64 pkid = rs->column_integer64(1);
|
||||
|
|
|
@ -61,13 +61,12 @@ std::atomic<logger::severity_type> logger::severity_level_
|
|||
bool logger::severity_env_check_{true};
|
||||
bool logger::format_env_check_{true};
|
||||
|
||||
logger::severity_type logger::severity_level_
|
||||
{
|
||||
logger::severity_type logger::severity_level_{
|
||||
#endif
|
||||
#if MAPNIK_DEFAULT_LOG_SEVERITY == 0
|
||||
logger::debug
|
||||
#elif MAPNIK_DEFAULT_LOG_SEVERITY == 1
|
||||
logger::warn
|
||||
logger::warn
|
||||
#elif MAPNIK_DEFAULT_LOG_SEVERITY == 2
|
||||
logger::error
|
||||
#elif MAPNIK_DEFAULT_LOG_SEVERITY == 3
|
||||
|
|
|
@ -215,8 +215,8 @@ struct grid_render_marker_visitor
|
|||
0.0,
|
||||
0.0,
|
||||
1.0,
|
||||
std::nullopt); // TODO: is 1.0 a valid default here, and do we even care in grid_renderer
|
||||
// what the image looks like?
|
||||
std::nullopt); // TODO: is 1.0 a valid default here, and do we even care in
|
||||
// grid_renderer what the image looks like?
|
||||
pixmap_.set_rectangle(feature_.id(),
|
||||
target,
|
||||
boost::math::iround(pos_.x - cx),
|
||||
|
|
|
@ -555,8 +555,7 @@ void Map::zoom_all()
|
|||
else
|
||||
{
|
||||
std::ostringstream s;
|
||||
s << "could not zoom to combined layer extents "
|
||||
<< "using zoom_all because proj4 could not "
|
||||
s << "could not zoom to combined layer extents " << "using zoom_all because proj4 could not "
|
||||
<< "back project any layer extents into the map srs "
|
||||
<< "(set map 'maximum-extent' to override layer extents)";
|
||||
throw std::runtime_error(s.str());
|
||||
|
|
|
@ -29,25 +29,24 @@
|
|||
namespace mapnik {
|
||||
|
||||
template std::optional<std::string> parameters::get(std::string const& key) const;
|
||||
template std::optional<std::string> parameters::get(std::string const& key,
|
||||
std::string const& default_opt_value) const;
|
||||
template std::optional<std::string> parameters::get(std::string const& key, std::string const& default_opt_value) const;
|
||||
|
||||
template std::optional<value_double> parameters::get(std::string const& key) const;
|
||||
template std::optional<value_double> parameters::get(std::string const& key,
|
||||
value_double const& default_opt_value) const;
|
||||
value_double const& default_opt_value) const;
|
||||
|
||||
template std::optional<value_bool> parameters::get(std::string const& key) const;
|
||||
template std::optional<value_bool> parameters::get(std::string const& key, value_bool const& default_opt_value) const;
|
||||
|
||||
template std::optional<boolean_type> parameters::get(std::string const& key) const;
|
||||
template std::optional<boolean_type> parameters::get(std::string const& key,
|
||||
boolean_type const& default_opt_value) const;
|
||||
boolean_type const& default_opt_value) const;
|
||||
|
||||
template std::optional<value_null> parameters::get(std::string const& key) const;
|
||||
template std::optional<value_null> parameters::get(std::string const& key, value_null const& default_opt_value) const;
|
||||
|
||||
template std::optional<value_integer> parameters::get(std::string const& key) const;
|
||||
template std::optional<value_integer> parameters::get(std::string const& key,
|
||||
value_integer const& default_opt_value) const;
|
||||
value_integer const& default_opt_value) const;
|
||||
|
||||
} // namespace mapnik
|
||||
|
|
|
@ -492,14 +492,14 @@ std::string proj_transform::definition() const
|
|||
}
|
||||
else
|
||||
#endif
|
||||
if (wgs84_to_merc_)
|
||||
{
|
||||
return "wgs84 => merc";
|
||||
}
|
||||
else if (merc_to_wgs84_)
|
||||
{
|
||||
return "merc => wgs84";
|
||||
}
|
||||
if (wgs84_to_merc_)
|
||||
{
|
||||
return "wgs84 => merc";
|
||||
}
|
||||
else if (merc_to_wgs84_)
|
||||
{
|
||||
return "merc => wgs84";
|
||||
}
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
|
|
|
@ -61,8 +61,8 @@ MAPNIK_DISABLE_WARNING_POP
|
|||
#include <optional>
|
||||
|
||||
namespace mapnik {
|
||||
using std::optional;
|
||||
using boost::property_tree::ptree;
|
||||
using std::optional;
|
||||
|
||||
void serialize_text_placements(ptree& node, text_placements_ptr const& p, bool explicit_defaults)
|
||||
{
|
||||
|
|
|
@ -95,49 +95,19 @@ class tiff_reader : public image_reader
|
|||
unsigned width() const final;
|
||||
unsigned height() const final;
|
||||
std::optional<box2d<double>> bounding_box() const final;
|
||||
inline bool has_alpha() const final
|
||||
{
|
||||
return has_alpha_;
|
||||
}
|
||||
inline bool has_alpha() const final { return has_alpha_; }
|
||||
void read(unsigned x, unsigned y, image_rgba8& image) final;
|
||||
image_any read(unsigned x, unsigned y, unsigned width, unsigned height) final;
|
||||
// methods specific to tiff reader
|
||||
unsigned bits_per_sample() const
|
||||
{
|
||||
return bps_;
|
||||
}
|
||||
unsigned sample_format() const
|
||||
{
|
||||
return sample_format_;
|
||||
}
|
||||
unsigned photometric() const
|
||||
{
|
||||
return photometric_;
|
||||
}
|
||||
bool is_tiled() const
|
||||
{
|
||||
return is_tiled_;
|
||||
}
|
||||
unsigned tile_width() const
|
||||
{
|
||||
return tile_width_;
|
||||
}
|
||||
unsigned tile_height() const
|
||||
{
|
||||
return tile_height_;
|
||||
}
|
||||
unsigned rows_per_strip() const
|
||||
{
|
||||
return rows_per_strip_;
|
||||
}
|
||||
unsigned planar_config() const
|
||||
{
|
||||
return planar_config_;
|
||||
}
|
||||
unsigned compression() const
|
||||
{
|
||||
return compression_;
|
||||
}
|
||||
unsigned bits_per_sample() const { return bps_; }
|
||||
unsigned sample_format() const { return sample_format_; }
|
||||
unsigned photometric() const { return photometric_; }
|
||||
bool is_tiled() const { return is_tiled_; }
|
||||
unsigned tile_width() const { return tile_width_; }
|
||||
unsigned tile_height() const { return tile_height_; }
|
||||
unsigned rows_per_strip() const { return rows_per_strip_; }
|
||||
unsigned planar_config() const { return planar_config_; }
|
||||
unsigned compression() const { return compression_; }
|
||||
|
||||
private:
|
||||
tiff_reader(const tiff_reader&);
|
||||
|
@ -720,7 +690,8 @@ void tiff_reader<T>::read_stripped(std::size_t x0, std::size_t y0, ImageData& im
|
|||
const std::size_t tx1{std::min(width + x0, width_)};
|
||||
|
||||
std::size_t row = 0;
|
||||
const bool pick_first_band = (bands_ > 1) && (strip_size / (width_ * rows_per_strip_ * sizeof(pixel_type)) == bands_);
|
||||
const bool pick_first_band =
|
||||
(bands_ > 1) && (strip_size / (width_ * rows_per_strip_ * sizeof(pixel_type)) == bands_);
|
||||
for (std::size_t y = start_y; y < end_y; y += rows_per_strip_)
|
||||
{
|
||||
const std::size_t ty0 = std::max(y0, y) - y;
|
||||
|
|
|
@ -58,7 +58,10 @@ struct name_trait
|
|||
template<> \
|
||||
struct name_trait<type> \
|
||||
{ \
|
||||
static std::string name() { return std::string("type ") + type_name; } \
|
||||
static std::string name() \
|
||||
{ \
|
||||
return std::string("type ") + type_name; \
|
||||
} \
|
||||
};
|
||||
|
||||
DEFINE_NAME_TRAIT(double, "double")
|
||||
|
|
365
test/catch.hpp
365
test/catch.hpp
|
@ -809,7 +809,7 @@ constexpr auto operator"" _catch_sr(char const* rawChars, std::size_t size) noex
|
|||
struct TypeList \
|
||||
{}; \
|
||||
template<typename... Ts> \
|
||||
constexpr auto get_wrapper() noexcept->TypeList<Ts...> \
|
||||
constexpr auto get_wrapper() noexcept -> TypeList<Ts...> \
|
||||
{ \
|
||||
return {}; \
|
||||
} \
|
||||
|
@ -817,7 +817,7 @@ constexpr auto operator"" _catch_sr(char const* rawChars, std::size_t size) noex
|
|||
struct TemplateTypeList \
|
||||
{}; \
|
||||
template<template<typename...> class... Cs> \
|
||||
constexpr auto get_wrapper() noexcept->TemplateTypeList<Cs...> \
|
||||
constexpr auto get_wrapper() noexcept -> TemplateTypeList<Cs...> \
|
||||
{ \
|
||||
return {}; \
|
||||
} \
|
||||
|
@ -883,7 +883,7 @@ constexpr auto operator"" _catch_sr(char const* rawChars, std::size_t size) noex
|
|||
struct Nttp \
|
||||
{}; \
|
||||
template<INTERNAL_CATCH_REMOVE_PARENS(signature)> \
|
||||
constexpr auto get_wrapper() noexcept->Nttp<__VA_ARGS__> \
|
||||
constexpr auto get_wrapper() noexcept -> Nttp<__VA_ARGS__> \
|
||||
{ \
|
||||
return {}; \
|
||||
} \
|
||||
|
@ -891,7 +891,7 @@ constexpr auto operator"" _catch_sr(char const* rawChars, std::size_t size) noex
|
|||
struct NttpTemplateTypeList \
|
||||
{}; \
|
||||
template<template<INTERNAL_CATCH_REMOVE_PARENS(signature)> class... Cs> \
|
||||
constexpr auto get_wrapper() noexcept->NttpTemplateTypeList<Cs...> \
|
||||
constexpr auto get_wrapper() noexcept -> NttpTemplateTypeList<Cs...> \
|
||||
{ \
|
||||
return {}; \
|
||||
} \
|
||||
|
@ -1351,9 +1351,8 @@ struct AutoReg : NonCopyable
|
|||
Signature, \
|
||||
...) \
|
||||
namespace { \
|
||||
namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName) \
|
||||
{ \
|
||||
INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD(TestName, ClassName, INTERNAL_CATCH_REMOVE_PARENS(Signature)); \
|
||||
namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName) { \
|
||||
INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD(TestName, ClassName, INTERNAL_CATCH_REMOVE_PARENS(Signature)); \
|
||||
} \
|
||||
} \
|
||||
INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD(TestName, INTERNAL_CATCH_REMOVE_PARENS(Signature))
|
||||
|
@ -1508,29 +1507,27 @@ struct AutoReg : NonCopyable
|
|||
CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \
|
||||
INTERNAL_CATCH_DECLARE_SIG_TEST(TestFunc, INTERNAL_CATCH_REMOVE_PARENS(Signature)); \
|
||||
namespace { \
|
||||
namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName) \
|
||||
namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName) { \
|
||||
INTERNAL_CATCH_TYPE_GEN \
|
||||
INTERNAL_CATCH_NTTP_GEN(INTERNAL_CATCH_REMOVE_PARENS(Signature)) \
|
||||
INTERNAL_CATCH_NTTP_REG_GEN(TestFunc, INTERNAL_CATCH_REMOVE_PARENS(Signature)) \
|
||||
template<typename... Types> \
|
||||
struct TestName \
|
||||
{ \
|
||||
INTERNAL_CATCH_TYPE_GEN \
|
||||
INTERNAL_CATCH_NTTP_GEN(INTERNAL_CATCH_REMOVE_PARENS(Signature)) \
|
||||
INTERNAL_CATCH_NTTP_REG_GEN(TestFunc, INTERNAL_CATCH_REMOVE_PARENS(Signature)) \
|
||||
template<typename... Types> \
|
||||
struct TestName \
|
||||
TestName() \
|
||||
{ \
|
||||
TestName() \
|
||||
{ \
|
||||
int index = 0; \
|
||||
constexpr char const* tmpl_types[] = { \
|
||||
CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, __VA_ARGS__)}; \
|
||||
using expander = int[]; \
|
||||
(void)expander{ \
|
||||
(reg_test(Types{}, Catch::NameAndTags{Name " - " + std::string(tmpl_types[index]), Tags}), \
|
||||
index++)...}; /* NOLINT */ \
|
||||
} \
|
||||
}; \
|
||||
static int INTERNAL_CATCH_UNIQUE_NAME(globalRegistrar) = []() { \
|
||||
TestName<INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(__VA_ARGS__)>(); \
|
||||
return 0; \
|
||||
}(); \
|
||||
int index = 0; \
|
||||
constexpr char const* tmpl_types[] = { \
|
||||
CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, __VA_ARGS__)}; \
|
||||
using expander = int[]; \
|
||||
(void)expander{(reg_test(Types{}, Catch::NameAndTags{Name " - " + std::string(tmpl_types[index]), Tags}), \
|
||||
index++)...}; /* NOLINT */ \
|
||||
} \
|
||||
}; \
|
||||
static int INTERNAL_CATCH_UNIQUE_NAME(globalRegistrar) = []() { \
|
||||
TestName<INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(__VA_ARGS__)>(); \
|
||||
return 0; \
|
||||
}(); \
|
||||
} \
|
||||
} \
|
||||
CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
|
||||
|
@ -1590,41 +1587,40 @@ struct AutoReg : NonCopyable
|
|||
template<typename TestType> \
|
||||
static void TestFuncName(); \
|
||||
namespace { \
|
||||
namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName) \
|
||||
namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName) { \
|
||||
INTERNAL_CATCH_TYPE_GEN \
|
||||
INTERNAL_CATCH_NTTP_GEN(INTERNAL_CATCH_REMOVE_PARENS(Signature)) \
|
||||
template<typename... Types> \
|
||||
struct TestName \
|
||||
{ \
|
||||
INTERNAL_CATCH_TYPE_GEN \
|
||||
INTERNAL_CATCH_NTTP_GEN(INTERNAL_CATCH_REMOVE_PARENS(Signature)) \
|
||||
template<typename... Types> \
|
||||
struct TestName \
|
||||
void reg_tests() \
|
||||
{ \
|
||||
void reg_tests() \
|
||||
{ \
|
||||
int index = 0; \
|
||||
using expander = int[]; \
|
||||
constexpr char const* tmpl_types[] = { \
|
||||
CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TmplTypes))}; \
|
||||
constexpr char const* types_list[] = { \
|
||||
CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TypesList))}; \
|
||||
constexpr auto num_types = sizeof(types_list) / sizeof(types_list[0]); \
|
||||
(void)expander{ \
|
||||
(Catch::AutoReg(Catch::makeTestInvoker(&TestFuncName<Types>), \
|
||||
CATCH_INTERNAL_LINEINFO, \
|
||||
Catch::StringRef(), \
|
||||
Catch::NameAndTags{Name " - " + std::string(tmpl_types[index / num_types]) + "<" + \
|
||||
std::string(types_list[index % num_types]) + ">", \
|
||||
Tags}), \
|
||||
index++)...}; /* NOLINT */ \
|
||||
} \
|
||||
}; \
|
||||
static int INTERNAL_CATCH_UNIQUE_NAME(globalRegistrar) = []() { \
|
||||
using TestInit = typename create< \
|
||||
TestName, \
|
||||
decltype(get_wrapper<INTERNAL_CATCH_REMOVE_PARENS(TmplTypes)>()), \
|
||||
TypeList<INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(INTERNAL_CATCH_REMOVE_PARENS(TypesList))>>::type; \
|
||||
TestInit t; \
|
||||
t.reg_tests(); \
|
||||
return 0; \
|
||||
}(); \
|
||||
int index = 0; \
|
||||
using expander = int[]; \
|
||||
constexpr char const* tmpl_types[] = { \
|
||||
CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TmplTypes))}; \
|
||||
constexpr char const* types_list[] = { \
|
||||
CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TypesList))}; \
|
||||
constexpr auto num_types = sizeof(types_list) / sizeof(types_list[0]); \
|
||||
(void)expander{ \
|
||||
(Catch::AutoReg(Catch::makeTestInvoker(&TestFuncName<Types>), \
|
||||
CATCH_INTERNAL_LINEINFO, \
|
||||
Catch::StringRef(), \
|
||||
Catch::NameAndTags{Name " - " + std::string(tmpl_types[index / num_types]) + "<" + \
|
||||
std::string(types_list[index % num_types]) + ">", \
|
||||
Tags}), \
|
||||
index++)...}; /* NOLINT */ \
|
||||
} \
|
||||
}; \
|
||||
static int INTERNAL_CATCH_UNIQUE_NAME(globalRegistrar) = []() { \
|
||||
using TestInit = typename create< \
|
||||
TestName, \
|
||||
decltype(get_wrapper<INTERNAL_CATCH_REMOVE_PARENS(TmplTypes)>()), \
|
||||
TypeList<INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(INTERNAL_CATCH_REMOVE_PARENS(TypesList))>>::type; \
|
||||
TestInit t; \
|
||||
t.reg_tests(); \
|
||||
return 0; \
|
||||
}(); \
|
||||
} \
|
||||
} \
|
||||
CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
|
||||
|
@ -1678,32 +1674,31 @@ struct AutoReg : NonCopyable
|
|||
template<typename TestType> \
|
||||
static void TestFunc(); \
|
||||
namespace { \
|
||||
namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName) \
|
||||
namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName) { \
|
||||
INTERNAL_CATCH_TYPE_GEN \
|
||||
template<typename... Types> \
|
||||
struct TestName \
|
||||
{ \
|
||||
INTERNAL_CATCH_TYPE_GEN \
|
||||
template<typename... Types> \
|
||||
struct TestName \
|
||||
void reg_tests() \
|
||||
{ \
|
||||
void reg_tests() \
|
||||
{ \
|
||||
int index = 0; \
|
||||
using expander = int[]; \
|
||||
(void)expander{ \
|
||||
(Catch::AutoReg(Catch::makeTestInvoker(&TestFunc<Types>), \
|
||||
CATCH_INTERNAL_LINEINFO, \
|
||||
Catch::StringRef(), \
|
||||
Catch::NameAndTags{Name " - " + std::string(INTERNAL_CATCH_STRINGIZE(TmplList)) + \
|
||||
" - " + std::to_string(index), \
|
||||
Tags}), \
|
||||
index++)...}; /* NOLINT */ \
|
||||
} \
|
||||
}; \
|
||||
static int INTERNAL_CATCH_UNIQUE_NAME(globalRegistrar) = []() { \
|
||||
using TestInit = typename convert<TestName, TmplList>::type; \
|
||||
TestInit t; \
|
||||
t.reg_tests(); \
|
||||
return 0; \
|
||||
}(); \
|
||||
int index = 0; \
|
||||
using expander = int[]; \
|
||||
(void)expander{ \
|
||||
(Catch::AutoReg(Catch::makeTestInvoker(&TestFunc<Types>), \
|
||||
CATCH_INTERNAL_LINEINFO, \
|
||||
Catch::StringRef(), \
|
||||
Catch::NameAndTags{Name " - " + std::string(INTERNAL_CATCH_STRINGIZE(TmplList)) + \
|
||||
" - " + std::to_string(index), \
|
||||
Tags}), \
|
||||
index++)...}; /* NOLINT */ \
|
||||
} \
|
||||
}; \
|
||||
static int INTERNAL_CATCH_UNIQUE_NAME(globalRegistrar) = []() { \
|
||||
using TestInit = typename convert<TestName, TmplList>::type; \
|
||||
TestInit t; \
|
||||
t.reg_tests(); \
|
||||
return 0; \
|
||||
}(); \
|
||||
} \
|
||||
} \
|
||||
CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
|
||||
|
@ -1724,31 +1719,29 @@ struct AutoReg : NonCopyable
|
|||
CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS \
|
||||
CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \
|
||||
namespace { \
|
||||
namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName) \
|
||||
namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName) { \
|
||||
INTERNAL_CATCH_TYPE_GEN \
|
||||
INTERNAL_CATCH_NTTP_GEN(INTERNAL_CATCH_REMOVE_PARENS(Signature)) \
|
||||
INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD(TestName, ClassName, INTERNAL_CATCH_REMOVE_PARENS(Signature)); \
|
||||
INTERNAL_CATCH_NTTP_REG_METHOD_GEN(TestName, INTERNAL_CATCH_REMOVE_PARENS(Signature)) \
|
||||
template<typename... Types> \
|
||||
struct TestNameClass \
|
||||
{ \
|
||||
INTERNAL_CATCH_TYPE_GEN \
|
||||
INTERNAL_CATCH_NTTP_GEN(INTERNAL_CATCH_REMOVE_PARENS(Signature)) \
|
||||
INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD(TestName, ClassName, INTERNAL_CATCH_REMOVE_PARENS(Signature)); \
|
||||
INTERNAL_CATCH_NTTP_REG_METHOD_GEN(TestName, INTERNAL_CATCH_REMOVE_PARENS(Signature)) \
|
||||
template<typename... Types> \
|
||||
struct TestNameClass \
|
||||
TestNameClass() \
|
||||
{ \
|
||||
TestNameClass() \
|
||||
{ \
|
||||
int index = 0; \
|
||||
constexpr char const* tmpl_types[] = { \
|
||||
CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, __VA_ARGS__)}; \
|
||||
using expander = int[]; \
|
||||
(void)expander{(reg_test(Types{}, \
|
||||
#ClassName, \
|
||||
Catch::NameAndTags{Name " - " + std::string(tmpl_types[index]), Tags}), \
|
||||
index++)...}; /* NOLINT */ \
|
||||
} \
|
||||
}; \
|
||||
static int INTERNAL_CATCH_UNIQUE_NAME(globalRegistrar) = []() { \
|
||||
TestNameClass<INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(__VA_ARGS__)>(); \
|
||||
return 0; \
|
||||
}(); \
|
||||
int index = 0; \
|
||||
constexpr char const* tmpl_types[] = { \
|
||||
CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, __VA_ARGS__)}; \
|
||||
using expander = int[]; \
|
||||
(void)expander{ \
|
||||
(reg_test(Types{}, #ClassName, Catch::NameAndTags{Name " - " + std::string(tmpl_types[index]), Tags}), \
|
||||
index++)...}; /* NOLINT */ \
|
||||
} \
|
||||
}; \
|
||||
static int INTERNAL_CATCH_UNIQUE_NAME(globalRegistrar) = []() { \
|
||||
TestNameClass<INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(__VA_ARGS__)>(); \
|
||||
return 0; \
|
||||
}(); \
|
||||
} \
|
||||
} \
|
||||
CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
|
||||
|
@ -1816,41 +1809,40 @@ struct AutoReg : NonCopyable
|
|||
void test(); \
|
||||
}; \
|
||||
namespace { \
|
||||
namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestNameClass) \
|
||||
namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestNameClass) { \
|
||||
INTERNAL_CATCH_TYPE_GEN \
|
||||
INTERNAL_CATCH_NTTP_GEN(INTERNAL_CATCH_REMOVE_PARENS(Signature)) \
|
||||
template<typename... Types> \
|
||||
struct TestNameClass \
|
||||
{ \
|
||||
INTERNAL_CATCH_TYPE_GEN \
|
||||
INTERNAL_CATCH_NTTP_GEN(INTERNAL_CATCH_REMOVE_PARENS(Signature)) \
|
||||
template<typename... Types> \
|
||||
struct TestNameClass \
|
||||
void reg_tests() \
|
||||
{ \
|
||||
void reg_tests() \
|
||||
{ \
|
||||
int index = 0; \
|
||||
using expander = int[]; \
|
||||
constexpr char const* tmpl_types[] = { \
|
||||
CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TmplTypes))}; \
|
||||
constexpr char const* types_list[] = { \
|
||||
CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TypesList))}; \
|
||||
constexpr auto num_types = sizeof(types_list) / sizeof(types_list[0]); \
|
||||
(void)expander{ \
|
||||
(Catch::AutoReg(Catch::makeTestInvoker(&TestName<Types>::test), \
|
||||
CATCH_INTERNAL_LINEINFO, \
|
||||
#ClassName, \
|
||||
Catch::NameAndTags{Name " - " + std::string(tmpl_types[index / num_types]) + "<" + \
|
||||
std::string(types_list[index % num_types]) + ">", \
|
||||
Tags}), \
|
||||
index++)...}; /* NOLINT */ \
|
||||
} \
|
||||
}; \
|
||||
static int INTERNAL_CATCH_UNIQUE_NAME(globalRegistrar) = []() { \
|
||||
using TestInit = typename create< \
|
||||
TestNameClass, \
|
||||
decltype(get_wrapper<INTERNAL_CATCH_REMOVE_PARENS(TmplTypes)>()), \
|
||||
TypeList<INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(INTERNAL_CATCH_REMOVE_PARENS(TypesList))>>::type; \
|
||||
TestInit t; \
|
||||
t.reg_tests(); \
|
||||
return 0; \
|
||||
}(); \
|
||||
int index = 0; \
|
||||
using expander = int[]; \
|
||||
constexpr char const* tmpl_types[] = { \
|
||||
CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TmplTypes))}; \
|
||||
constexpr char const* types_list[] = { \
|
||||
CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TypesList))}; \
|
||||
constexpr auto num_types = sizeof(types_list) / sizeof(types_list[0]); \
|
||||
(void)expander{ \
|
||||
(Catch::AutoReg(Catch::makeTestInvoker(&TestName<Types>::test), \
|
||||
CATCH_INTERNAL_LINEINFO, \
|
||||
#ClassName, \
|
||||
Catch::NameAndTags{Name " - " + std::string(tmpl_types[index / num_types]) + "<" + \
|
||||
std::string(types_list[index % num_types]) + ">", \
|
||||
Tags}), \
|
||||
index++)...}; /* NOLINT */ \
|
||||
} \
|
||||
}; \
|
||||
static int INTERNAL_CATCH_UNIQUE_NAME(globalRegistrar) = []() { \
|
||||
using TestInit = typename create< \
|
||||
TestNameClass, \
|
||||
decltype(get_wrapper<INTERNAL_CATCH_REMOVE_PARENS(TmplTypes)>()), \
|
||||
TypeList<INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(INTERNAL_CATCH_REMOVE_PARENS(TypesList))>>::type; \
|
||||
TestInit t; \
|
||||
t.reg_tests(); \
|
||||
return 0; \
|
||||
}(); \
|
||||
} \
|
||||
} \
|
||||
CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
|
||||
|
@ -1911,32 +1903,31 @@ struct AutoReg : NonCopyable
|
|||
void test(); \
|
||||
}; \
|
||||
namespace { \
|
||||
namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName) \
|
||||
namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName) { \
|
||||
INTERNAL_CATCH_TYPE_GEN \
|
||||
template<typename... Types> \
|
||||
struct TestNameClass \
|
||||
{ \
|
||||
INTERNAL_CATCH_TYPE_GEN \
|
||||
template<typename... Types> \
|
||||
struct TestNameClass \
|
||||
void reg_tests() \
|
||||
{ \
|
||||
void reg_tests() \
|
||||
{ \
|
||||
int index = 0; \
|
||||
using expander = int[]; \
|
||||
(void)expander{ \
|
||||
(Catch::AutoReg(Catch::makeTestInvoker(&TestName<Types>::test), \
|
||||
CATCH_INTERNAL_LINEINFO, \
|
||||
#ClassName, \
|
||||
Catch::NameAndTags{Name " - " + std::string(INTERNAL_CATCH_STRINGIZE(TmplList)) + \
|
||||
" - " + std::to_string(index), \
|
||||
Tags}), \
|
||||
index++)...}; /* NOLINT */ \
|
||||
} \
|
||||
}; \
|
||||
static int INTERNAL_CATCH_UNIQUE_NAME(globalRegistrar) = []() { \
|
||||
using TestInit = typename convert<TestNameClass, TmplList>::type; \
|
||||
TestInit t; \
|
||||
t.reg_tests(); \
|
||||
return 0; \
|
||||
}(); \
|
||||
int index = 0; \
|
||||
using expander = int[]; \
|
||||
(void)expander{ \
|
||||
(Catch::AutoReg(Catch::makeTestInvoker(&TestName<Types>::test), \
|
||||
CATCH_INTERNAL_LINEINFO, \
|
||||
#ClassName, \
|
||||
Catch::NameAndTags{Name " - " + std::string(INTERNAL_CATCH_STRINGIZE(TmplList)) + \
|
||||
" - " + std::to_string(index), \
|
||||
Tags}), \
|
||||
index++)...}; /* NOLINT */ \
|
||||
} \
|
||||
}; \
|
||||
static int INTERNAL_CATCH_UNIQUE_NAME(globalRegistrar) = []() { \
|
||||
using TestInit = typename convert<TestNameClass, TmplList>::type; \
|
||||
TestInit t; \
|
||||
t.reg_tests(); \
|
||||
return 0; \
|
||||
}(); \
|
||||
} \
|
||||
} \
|
||||
CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
|
||||
|
@ -3217,8 +3208,8 @@ struct IResultCapture
|
|||
virtual void sectionEnded(SectionEndInfo const& endInfo) = 0;
|
||||
virtual void sectionEndedEarly(SectionEndInfo const& endInfo) = 0;
|
||||
|
||||
virtual auto acquireGeneratorTracker(StringRef generatorName, SourceLineInfo const& lineInfo)
|
||||
-> IGeneratorTracker& = 0;
|
||||
virtual auto acquireGeneratorTracker(StringRef generatorName,
|
||||
SourceLineInfo const& lineInfo) -> IGeneratorTracker& = 0;
|
||||
|
||||
#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
|
||||
virtual void benchmarkPreparing(std::string const& name) = 0;
|
||||
|
@ -4693,8 +4684,9 @@ using StringMatcher = Matchers::Impl::MatcherBase<std::string>;
|
|||
void handleExceptionMatchExpr(AssertionHandler& handler, StringMatcher const& matcher, StringRef const& matcherString);
|
||||
|
||||
template<typename ArgT, typename MatcherT>
|
||||
auto makeMatchExpr(ArgT const& arg, MatcherT const& matcher, StringRef const& matcherString)
|
||||
-> MatchExpr<ArgT, MatcherT>
|
||||
auto makeMatchExpr(ArgT const& arg,
|
||||
MatcherT const& matcher,
|
||||
StringRef const& matcherString) -> MatchExpr<ArgT, MatcherT>
|
||||
{
|
||||
return MatchExpr<ArgT, MatcherT>(arg, matcher, matcherString);
|
||||
}
|
||||
|
@ -5010,8 +5002,9 @@ template<typename L>
|
|||
// Note: The type after -> is weird, because VS2015 cannot parse
|
||||
// the expression used in the typedef inside, when it is in
|
||||
// return type. Yeah.
|
||||
auto generate(StringRef generatorName, SourceLineInfo const& lineInfo, L const& generatorExpression)
|
||||
-> decltype(std::declval<decltype(generatorExpression())>().get())
|
||||
auto generate(StringRef generatorName,
|
||||
SourceLineInfo const& lineInfo,
|
||||
L const& generatorExpression) -> decltype(std::declval<decltype(generatorExpression())>().get())
|
||||
{
|
||||
using UnderlyingType = typename decltype(generatorExpression())::type;
|
||||
|
||||
|
@ -5376,10 +5369,10 @@ class Option
|
|||
: nullableValue(nullptr)
|
||||
{}
|
||||
Option(T const& _value)
|
||||
: nullableValue(new (storage) T(_value))
|
||||
: nullableValue(new(storage) T(_value))
|
||||
{}
|
||||
Option(Option const& _other)
|
||||
: nullableValue(_other ? new (storage) T(*_other) : nullptr)
|
||||
: nullableValue(_other ? new(storage) T(*_other) : nullptr)
|
||||
{}
|
||||
|
||||
~Option() { reset(); }
|
||||
|
@ -9283,8 +9276,8 @@ class RunContext : public IResultCapture,
|
|||
void sectionEnded(SectionEndInfo const& endInfo) override;
|
||||
void sectionEndedEarly(SectionEndInfo const& endInfo) override;
|
||||
|
||||
auto acquireGeneratorTracker(StringRef generatorName, SourceLineInfo const& lineInfo)
|
||||
-> IGeneratorTracker& override;
|
||||
auto acquireGeneratorTracker(StringRef generatorName,
|
||||
SourceLineInfo const& lineInfo) -> IGeneratorTracker& override;
|
||||
|
||||
#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
|
||||
void benchmarkPreparing(std::string const& name) override;
|
||||
|
@ -10840,7 +10833,7 @@ struct Help : Opt
|
|||
return ParserResult::ok(ParseResultType::ShortCircuitAll);
|
||||
})
|
||||
{
|
||||
static_cast<Opt&> (*this)("display usage information")["-?"]["-h"]["--help"].optional();
|
||||
static_cast<Opt&>(*this)("display usage information")["-?"]["-h"]["--help"].optional();
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -12362,8 +12355,7 @@ FatalConditionHandler::FatalConditionHandler()
|
|||
{
|
||||
// We do not want to fully error out, because needing
|
||||
// the stack reserve should be rare enough anyway.
|
||||
Catch::cerr() << "Failed to reserve piece of stack."
|
||||
<< " Stack overflows will not be reported successfully.";
|
||||
Catch::cerr() << "Failed to reserve piece of stack." << " Stack overflows will not be reported successfully.";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -14191,10 +14183,7 @@ class RegistryHub : public IRegistryHub,
|
|||
CATCH_INTERNAL_ERROR("Attempted to register active exception under CATCH_CONFIG_DISABLE_EXCEPTIONS!");
|
||||
#endif
|
||||
}
|
||||
IMutableEnumValuesRegistry& getMutableEnumValuesRegistry() override
|
||||
{
|
||||
return m_enumValuesRegistry;
|
||||
}
|
||||
IMutableEnumValuesRegistry& getMutableEnumValuesRegistry() override { return m_enumValuesRegistry; }
|
||||
|
||||
private:
|
||||
TestRegistry m_testCaseRegistry;
|
||||
|
@ -15241,12 +15230,9 @@ void Session::showHelp() const
|
|||
}
|
||||
void Session::libIdentify()
|
||||
{
|
||||
Catch::cout() << std::left << std::setw(16) << "description: "
|
||||
<< "A Catch2 test executable\n"
|
||||
<< std::left << std::setw(16) << "category: "
|
||||
<< "testframework\n"
|
||||
<< std::left << std::setw(16) << "framework: "
|
||||
<< "Catch Test\n"
|
||||
Catch::cout() << std::left << std::setw(16) << "description: " << "A Catch2 test executable\n"
|
||||
<< std::left << std::setw(16) << "category: " << "testframework\n"
|
||||
<< std::left << std::setw(16) << "framework: " << "Catch Test\n"
|
||||
<< std::left << std::setw(16) << "version: " << libraryVersion() << std::endl;
|
||||
}
|
||||
|
||||
|
@ -19364,8 +19350,7 @@ void JunitReporter::writeAssertion(AssertionStats const& stats)
|
|||
ReusableStringStream rss;
|
||||
if (stats.totals.assertions.total() > 0)
|
||||
{
|
||||
rss << "FAILED"
|
||||
<< ":\n";
|
||||
rss << "FAILED" << ":\n";
|
||||
if (result.hasExpression())
|
||||
{
|
||||
rss << " ";
|
||||
|
|
|
@ -68,13 +68,12 @@ class tmp_dir
|
|||
}
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
std::cerr << "Exception caught while trying to remove "
|
||||
<< "temporary directory " << m_path << ": " << e.what() << "\n";
|
||||
std::cerr << "Exception caught while trying to remove " << "temporary directory " << m_path << ": "
|
||||
<< e.what() << "\n";
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
std::cerr << "Unknown exception caught while trying to "
|
||||
<< "remove temporary directory " << m_path << "\n";
|
||||
std::cerr << "Unknown exception caught while trying to " << "remove temporary directory " << m_path << "\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ TEST_CASE("CSS color")
|
|||
CHECK(c.green() == 0x00);
|
||||
CHECK(c.blue() == 0xff);
|
||||
// rgba (fractional percent)
|
||||
std::string s2("rgb(50.5%,0.5%,99.5%)"); //#8101fe80
|
||||
std::string s2("rgb(50.5%,0.5%,99.5%)"); // #8101fe80
|
||||
CHECK(boost::spirit::x3::phrase_parse(s2.cbegin(), s2.cend(), color_grammar, space, c));
|
||||
CHECK(c.alpha() == 0x80);
|
||||
CHECK(c.red() == 0x81);
|
||||
|
|
|
@ -55,8 +55,8 @@ std::ostream& operator<<(std::ostream& os, mapnik::gradient const& gr)
|
|||
double cx, cy, fx, fy, r;
|
||||
gr.get_control_points(fx, fy, cx, cy, r);
|
||||
|
||||
os << "<gradient cx=\"" << cx << "\" cy=\"" << cy << "\""
|
||||
<< " fx=\"" << fx << "\" fy=\"" << fy << "\" r=\"" << r << "\">\n";
|
||||
os << "<gradient cx=\"" << cx << "\" cy=\"" << cy << "\"" << " fx=\"" << fx << "\" fy=\"" << fy << "\" r=\"" << r
|
||||
<< "\">\n";
|
||||
for (auto const& stop : gr.get_stop_array())
|
||||
{
|
||||
os << " <stop offset=\"" << std::get<0>(stop) << "\" color=\"" << std::get<1>(stop) << "\"/>\n";
|
||||
|
|
|
@ -212,8 +212,7 @@ int main(int argc, char** argv)
|
|||
|
||||
catch (...)
|
||||
{
|
||||
std::clog << "unknown exception..."
|
||||
<< "\n";
|
||||
std::clog << "unknown exception..." << "\n";
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#include <mapnik/version.hpp>
|
||||
#include <mapnik/util/fs.hpp>
|
||||
#include <mapnik/quad_tree.hpp>
|
||||
//#include <mapnik/util/spatial_index.hpp>
|
||||
// #include <mapnik/util/spatial_index.hpp>
|
||||
#include <mapnik/geometry/envelope.hpp>
|
||||
#include "shapefile.hpp"
|
||||
#include "shape_io.hpp"
|
||||
|
|
Loading…
Reference in a new issue