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]
|
||||
|
|
|
@ -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,12 +134,12 @@ 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(), \
|
||||
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 std::pair<enum_class, std::string>{std::get<0>(val), \
|
||||
std::string{std::get<1>(val).data()}}; \
|
||||
}); \
|
||||
return val_map; \
|
||||
}
|
||||
|
|
|
@ -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_;
|
||||
|
|
|
@ -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<>
|
||||
|
|
|
@ -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()
|
||||
{
|
||||
|
|
|
@ -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:
|
||||
|
||||
|
|
|
@ -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,8 +61,7 @@ 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
|
||||
|
|
|
@ -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,8 +29,7 @@
|
|||
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,
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -1351,8 +1351,7 @@ struct AutoReg : NonCopyable
|
|||
Signature, \
|
||||
...) \
|
||||
namespace { \
|
||||
namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName) \
|
||||
{ \
|
||||
namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName) { \
|
||||
INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD(TestName, ClassName, INTERNAL_CATCH_REMOVE_PARENS(Signature)); \
|
||||
} \
|
||||
} \
|
||||
|
@ -1508,8 +1507,7 @@ 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)) \
|
||||
|
@ -1522,8 +1520,7 @@ struct AutoReg : NonCopyable
|
|||
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}), \
|
||||
(void)expander{(reg_test(Types{}, Catch::NameAndTags{Name " - " + std::string(tmpl_types[index]), Tags}), \
|
||||
index++)...}; /* NOLINT */ \
|
||||
} \
|
||||
}; \
|
||||
|
@ -1590,8 +1587,7 @@ 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> \
|
||||
|
@ -1678,8 +1674,7 @@ 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 \
|
||||
|
@ -1724,8 +1719,7 @@ 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)); \
|
||||
|
@ -1739,9 +1733,8 @@ struct AutoReg : NonCopyable
|
|||
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}), \
|
||||
(void)expander{ \
|
||||
(reg_test(Types{}, #ClassName, Catch::NameAndTags{Name " - " + std::string(tmpl_types[index]), Tags}), \
|
||||
index++)...}; /* NOLINT */ \
|
||||
} \
|
||||
}; \
|
||||
|
@ -1816,8 +1809,7 @@ 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> \
|
||||
|
@ -1911,8 +1903,7 @@ 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 \
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue