[test] Fix unused typedef warnings

This commit is contained in:
Adam Wulkiewicz 2014-06-03 16:20:11 +02:00
parent 948208a485
commit 188b1c3e48
32 changed files with 76 additions and 44 deletions

View File

@ -87,7 +87,8 @@ void test_mixed_of()
typedef boost::geometry::model::box<P1> box_type1;
typedef boost::geometry::model::box<P2> box_type2;
polygon_type1 poly1, poly2;
polygon_type1 poly1;
polygon_type2 poly2;
boost::geometry::read_wkt("POLYGON((0 0,0 5,5 5,5 0,0 0))", poly1);
boost::geometry::read_wkt("POLYGON((0 0,0 5,5 5,5 0,0 0))", poly2);

View File

@ -22,23 +22,23 @@
template <typename P>
void test_pl()
{
typedef bg::model::multi_point<P> mpt;
/*typedef bg::model::multi_point<P> mpt;
typedef bg::model::linestring<P> ls;
// not implemented yet
/*test_geometry<mpt, ls>("MULTIPOINT(0 0,1 1)", "LINESTRING(0 0,1 0,3 3)", true);
test_geometry<mpt, ls>("MULTIPOINT(0 0,1 1)", "LINESTRING(0 0,1 0,3 3)", true);
test_geometry<mpt, ls>("MULTIPOINT(0 0,1 1)", "LINESTRING(0 0,1 1,3 3)", false);*/
}
template <typename P>
void test_pa()
{
typedef bg::model::multi_point<P> mpt;
/*typedef bg::model::multi_point<P> mpt;
typedef bg::model::polygon<P> poly;
typedef bg::model::multi_polygon<poly> mpoly;
// not implemented yet
/*test_geometry<mpt, poly>("MULTIPOINT(0 0,6 6)", "POLYGON((0 0,0 5,5 5,5 0,0 0))", true);
test_geometry<mpt, poly>("MULTIPOINT(0 0,6 6)", "POLYGON((0 0,0 5,5 5,5 0,0 0))", true);
test_geometry<mpt, poly>("MULTIPOINT(0 0,1 1)", "POLYGON((0 0,0 5,5 5,5 0,0 0))", false);*/
}

View File

@ -114,7 +114,6 @@ template <typename P>
void test_distance_segment()
{
typedef typename bg::default_distance_result<P>::type return_type;
typedef typename bg::coordinate_type<P>::type coordinate_type;
P s1; bg::set<0>(s1, 1); bg::set<1>(s1, 1);
P s2; bg::set<0>(s2, 4); bg::set<1>(s2, 4);

View File

@ -108,7 +108,7 @@ void test_all()
typedef bg::model::box<P> box;
typedef bg::model::ring<P> ring;
typedef bg::model::polygon<P> polygon;
typedef bg::model::linestring<P> linestring;
//typedef bg::model::linestring<P> linestring;
std::string case_p1 = "POLYGON((0 0,0 2,2 2,0 0))";

View File

@ -19,6 +19,8 @@
// Test which would fail then are disabled automatically
// #define BOOST_GEOMETRY_NO_ROBUSTNESS
#include <boost/core/ignore_unused.hpp>
#include <boost/geometry/geometries/point_xy.hpp>
#include <boost/geometry/geometries/register/linestring.hpp>
@ -341,7 +343,7 @@ void test_point_output()
typedef bg::model::linestring<P> linestring;
typedef bg::model::polygon<P> polygon;
typedef bg::model::box<P> box;
typedef bg::model::segment<P> segment;
//typedef bg::model::segment<P> segment;
test_point_output<polygon, polygon>(simplex_normal[0], simplex_normal[1], 6);
test_point_output<box, polygon>("box(1 1,6 4)", simplex_normal[0], 4);
@ -411,6 +413,7 @@ void test_all()
typedef bg::model::polygon<P, false> polygon_ccw;
typedef bg::model::polygon<P, true, false> polygon_open;
typedef bg::model::polygon<P, false, false> polygon_ccw_open;
boost::ignore_unused<polygon_ccw, polygon_open, polygon_ccw_open>();
std::string clip = "box(2 2,8 8)";

View File

@ -195,9 +195,6 @@ void test_all()
typedef bg::model::linestring<P> linestring;
typedef bg::model::box<P> box;
// Expected count, average x, average y
typedef boost::tuple<int> Tuple;
#ifdef BOOST_GEOMETRY_DEBUG_INTERSECTION
std::cout << string_from_type<T>::name() << std::endl;
#endif
@ -344,8 +341,6 @@ void test_ccw()
{
typedef bg::model::point<T, 2, bg::cs::cartesian> P;
typedef bg::model::polygon<P, false, true> polygon;
typedef boost::tuple<int> Tuple;
test_get_turns<polygon, polygon>::apply("ccw_1",
6,
@ -362,7 +357,6 @@ void test_open()
{
typedef bg::model::point<T, 2, bg::cs::cartesian> P;
typedef bg::model::polygon<P, true, false> polygon;
typedef boost::tuple<int> Tuple;
test_get_turns<polygon, polygon>::apply("open_1",
6,

View File

@ -164,10 +164,9 @@ void test_self_overlay(std::string const& case_id, T const& expected,
template <typename P>
void test_self_all()
void test_self_poly()
{
typedef bg::model::polygon<P> polygon;
typedef bg::model::linestring<P> linestring;
// Just a normal polygon
test_self_overlay<polygon>("1", 0,
@ -255,6 +254,12 @@ void test_self_all()
test_self_overlay<polygon>("ggl_list_2013_11_06_joan", 0, ggl_list_2013_11_06_joan);
test_self_overlay<polygon>("ggl_list_20131119_james", 0, ggl_list_20131119_james[0]);
}
template <typename P>
void test_self_ls()
{
//typedef bg::model::linestring<P> linestring;
// Same case - but if this is a linestring.
// TODO: this does not compile yet, but it should return 1 intersection point at the "closing" point
@ -262,6 +267,12 @@ void test_self_all()
// test_self_overlay<linestring>("ggl_list_2013_11_06_joan_linestring", 1, ggl_list_2013_11_06_joan_linestring);
}
template <typename P>
void test_self_all()
{
test_self_poly<P>();
test_self_ls<P>();
}
int test_main(int, char* [])
{

View File

@ -423,7 +423,7 @@ void test_all(bool test_self_tangencies = true, bool test_mixed = false)
typedef bg::model::point<T, 2, bg::cs::cartesian> P;
typedef bg::model::polygon<P> polygon;
typedef bg::model::box<P> box;
//typedef bg::model::box<P> box;
// 1-6
test_traverse<polygon, polygon, operation_intersection>::apply("1", 1, 5.4736, case_1[0], case_1[1]);

View File

@ -101,9 +101,12 @@ void test_geometry(std::string const& id, std::string const& wkt,
template <typename P, bool Clockwise, bool Closed>
void test_polygons()
{
typedef bg::model::ring<P> ring;
typedef bg::model::ring<P, Clockwise, Closed> ring;
typedef bg::model::polygon<P, Clockwise, Closed> polygon;
test_geometry<ring>("box",
"POLYGON((0 0,0 4,4 4,4 0,0 0))",
16, 16);
test_geometry<polygon>("box",
"POLYGON((0 0,0 4,4 4,4 0,0 0))",
16, 16);
@ -166,7 +169,6 @@ void test_polygons()
template <typename P, bool Clockwise, bool Closed>
void test_multi_polygons()
{
typedef bg::model::ring<P> ring;
typedef bg::model::polygon<P, Clockwise, Closed> polygon;
typedef bg::model::multi_polygon<polygon> multi_polygon;

View File

@ -12,9 +12,11 @@
#include <fstream>
#include <iomanip>
#include <boost/foreach.hpp>
#include <geometry_test_common.hpp>
#include <boost/core/ignore_unused.hpp>
#include <boost/foreach.hpp>
#include <boost/range/algorithm/copy.hpp>
#include <boost/geometry/algorithms/correct.hpp>
@ -90,9 +92,10 @@ void test_difference(std::string const& caseid, G1 const& g1, G2 const& g2,
double percentage = 0.0001,
bool sym = false)
{
std::vector<OutputType> clip;
typedef typename bg::coordinate_type<G1>::type coordinate_type;
boost::ignore_unused<coordinate_type>();
std::vector<OutputType> clip;
if (sym)
{

View File

@ -12,6 +12,7 @@
#include <fstream>
#include <iomanip>
#include <boost/core/ignore_unused.hpp>
#include <boost/foreach.hpp>
#include <boost/geometry/algorithms/intersection.hpp>
@ -47,6 +48,7 @@ check_result(
typedef typename bg::coordinate_type<G1>::type coordinate_type;
typedef typename bg::point_type<G1>::type point_type;
boost::ignore_unused<coordinate_type, point_type>();
typename bg::default_area_result<G1>::type length_or_area = 0;
int n = 0;
@ -158,7 +160,6 @@ typename bg::default_area_result<G1>::type test_intersection(std::string const&
std::cout << std::endl << "case " << caseid << std::endl;
}
typedef typename bg::coordinate_type<G1>::type coordinate_type;
typedef typename bg::point_type<G1>::type point_type;
if (! debug)

View File

@ -124,7 +124,7 @@ private:
static inline void base_test_all(Geometry1 const& geometry1,
Geometry2 const& geometry2)
{
typedef typename boost::range_value<MultiLineString>::type LineString;
//typedef typename boost::range_value<MultiLineString>::type LineString;
typedef typename bg::point_type<MultiLineString>::type Point;
typedef bg::model::multi_point<Point> multi_point;

View File

@ -190,8 +190,6 @@ private:
MP const& mp_expected,
std::string const& case_id)
{
typedef typename boost::range_value<MultiPoint>::type Point;
MultiPoint mp_output;
set_op<OverlayType>::apply(geometry1, geometry2, mp_output);

View File

@ -86,7 +86,6 @@ void test_geometry(std::string const& wkt, std::string const& expected, double d
// Check using user-specified strategy
typedef typename bg::point_type<Geometry>::type point_type;
typedef typename bg::cs_tag<point_type>::type tag;
typedef bg::strategy::distance::projected_point<double> strategy;
typedef bg::strategy::simplify::douglas_peucker
<

View File

@ -13,6 +13,7 @@
#include <geometry_test_common.hpp>
#include <boost/core/ignore_unused.hpp>
#include <boost/range/algorithm/copy.hpp>
#include <boost/geometry/algorithms/union.hpp>
@ -42,6 +43,8 @@ void test_union(std::string const& caseid, G1 const& g1, G2 const& g2,
double percentage)
{
typedef typename bg::coordinate_type<G1>::type coordinate_type;
boost::ignore_unused<coordinate_type>();
std::vector<OutputType> clip;
#if defined(BOOST_GEOMETRY_DEBUG_ROBUSTNESS)

View File

@ -106,7 +106,8 @@ void test_mixed_of()
typedef boost::geometry::model::box<P1> box_type1;
typedef boost::geometry::model::box<P2> box_type2;
polygon_type1 poly1, poly2;
polygon_type1 poly1;
polygon_type2 poly2;
boost::geometry::read_wkt("POLYGON((0 0,0 5,5 5,5 0,0 0))", poly1);
boost::geometry::read_wkt("POLYGON((0 0,0 5,5 5,5 0,0 0))", poly2);

View File

@ -111,7 +111,6 @@ void test_all()
template <typename Point>
void test_spherical()
{
typedef typename bg::coordinate_type<Point>::type ct;
bg::model::polygon<Point> wrangel;
// SQL Server check (no geography::STWithin, so check with intersection trick)

View File

@ -11,6 +11,7 @@
#include <vector>
#include <geometry_test_common.hpp>
#include <boost/core/ignore_unused.hpp>
#include <boost/geometry/geometries/geometries.hpp>
#include <boost/geometry/multi/multi.hpp>
@ -70,10 +71,10 @@ void test_geometry(G const& geometry, std::size_t expected_size = 0)
typedef typename bg::point_type<G>::type P;
typedef typename bg::coordinate_type<P>::type C;
boost::ignore_unused<P, C>();
// Check range-like behaviour
BOOST_CHECK_EQUAL(boost::size(geometry), expected_size);
}
template <typename P>

View File

@ -16,6 +16,8 @@
#include <geometry_test_common.hpp>
#include <boost/core/ignore_unused.hpp>
#include <boost/geometry/geometries/concepts/segment_concept.hpp>
#include <boost/geometry/geometries/point.hpp>
@ -52,7 +54,7 @@ void test_all()
typedef typename bg::coordinate_type<S>::type T;
typedef typename bg::point_type<S>::type SP;
boost::ignore_unused<T, SP>();
//std::cout << sizeof(typename coordinate_type<S>::type) << std::endl;
@ -63,6 +65,7 @@ void test_all()
typedef typename bg::coordinate_type<CS>::type CT;
typedef typename bg::point_type<CS>::type CSP;
boost::ignore_unused<CT, CSP>();
}

View File

@ -15,6 +15,8 @@
#include <algorithms/test_centroid.hpp>
#include <boost/core/ignore_unused.hpp>
#include <boost/geometry/multi/core/point_order.hpp>
#include <boost/geometry/multi/algorithms/centroid.hpp>
#include <boost/geometry/multi/strategies/cartesian/centroid_average.hpp>
@ -35,6 +37,8 @@ template <typename P>
void test_2d(bool is_integer = false)
{
typedef typename bg::coordinate_type<P>::type ct;
boost::ignore_unused<ct>();
#ifdef REPORT_RESULTS
std::cout << std::endl << "type: " << typeid(ct).name() << " size: " << sizeof(ct) << std::endl;
#endif

View File

@ -202,7 +202,7 @@ void test_areal_linear()
template <typename P>
void test_all()
{
typedef bg::model::box<P> box;
//typedef bg::model::box<P> box;
typedef bg::model::ring<P> ring;
typedef bg::model::polygon<P> polygon;
typedef bg::model::multi_polygon<polygon> multi_polygon;

View File

@ -49,7 +49,7 @@ void test_2d()
template <typename P>
void test_3d()
{
typedef bg::model::multi_point<P> mp;
//typedef bg::model::multi_point<P> mp;
}

View File

@ -183,7 +183,7 @@ void test_areal_linear()
template <typename P>
void test_all()
{
typedef bg::model::box<P> box;
//typedef bg::model::box<P> box;
typedef bg::model::ring<P> ring;
typedef bg::model::polygon<P> polygon;
typedef bg::model::multi_polygon<polygon> multi_polygon;

View File

@ -32,7 +32,6 @@ template <typename Container>
inline std::string coordinates(Container const& points)
{
std::ostringstream out;
typedef typename boost::range_value<Container>::type point_type;
for (typename boost::range_const_iterator<Container>::type it = boost::begin(points);
it != boost::end(points);
++it)
@ -132,8 +131,6 @@ void test_2d_compare()
template <typename P>
void test_2d_sort()
{
typedef typename bg::coordinate_type<P>::type ct;
std::vector<P> v;
v.push_back(bg::make<P>(3, 1));
v.push_back(bg::make<P>(2, 3));

View File

@ -20,6 +20,8 @@
#include <geometry_test_common.hpp>
#include <boost/core/ignore_unused.hpp>
#include <boost/geometry/io/wkt/read.hpp>
#include <boost/geometry/algorithms/assign.hpp>
@ -73,6 +75,9 @@ void test_distance(
<
bg::segment_tag, bg::point_tag, Point, Point
>::type reversed_tags_cross_track_strategy_type;
boost::ignore_unused<cross_track_strategy_type,
reversed_tags_cross_track_strategy_type>();
}

View File

@ -17,6 +17,7 @@
#include <boost/concept/requires.hpp>
#include <boost/concept_check.hpp>
#include <boost/core/ignore_unused.hpp>
#include <boost/geometry/algorithms/assign.hpp>
#include <boost/geometry/strategies/spherical/distance_haversine.hpp>
@ -94,6 +95,8 @@ void test_services()
<
bg::point_tag, bg::point_tag, P1, P2
>::type haversine_strategy_type;
boost::ignore_unused<haversine_strategy_type>();
}
P1 p1;

View File

@ -20,6 +20,8 @@
#include <geometry_test_common.hpp>
#include <boost/core/ignore_unused.hpp>
#include <boost/geometry/strategies/cartesian/distance_projected_point.hpp>
#include <boost/geometry/strategies/concepts/distance_concept.hpp>
@ -67,6 +69,9 @@ void test_services()
<
bg::segment_tag, bg::point_tag, PS, P
>::type reversed_tags_projected_point_strategy_type;
boost::ignore_unused<projected_point_strategy_type,
reversed_tags_projected_point_strategy_type>();
}
// 1: normal, calculate distance:

View File

@ -23,6 +23,7 @@
#include <boost/concept/requires.hpp>
#include <boost/concept_check.hpp>
#include <boost/core/ignore_unused.hpp>
#include <boost/geometry/algorithms/assign.hpp>
#include <boost/geometry/strategies/cartesian/distance_pythagoras.hpp>
@ -126,6 +127,8 @@ void test_services()
<
bg::point_tag, bg::point_tag, P1, P2
>::type pythagoras_strategy_type;
boost::ignore_unused<pythagoras_strategy_type>();
}

View File

@ -62,7 +62,6 @@ static void test_segment_intersection(std::string const& case_id,
{
boost::ignore_unused_variable_warning(case_id);
typedef typename bg::coordinate_type<P>::type coordinate_type;
typedef bg::model::referring_segment<const P> segment_type;
P p1, p2, p3, p4;
@ -124,7 +123,6 @@ static void test_segment_ratio(std::string const& case_id,
{
boost::ignore_unused_variable_warning(case_id);
typedef typename bg::coordinate_type<P>::type coordinate_type;
typedef bg::model::referring_segment<const P> segment_type;
P p1, p2, p3, p4;

View File

@ -91,8 +91,6 @@ void test_side(std::string const& case_id, Point const& p1, Point const& p2, Poi
template <typename Point>
void test_all()
{
typedef std::pair<double, double> pair;
Point amsterdam(5.9, 52.4);
Point barcelona(2.0, 41.0);
Point paris(2.0, 48.0);

View File

@ -239,12 +239,11 @@ inline void to_svg(G1 const& g1, G2 const& g2, std::string const& filename, bool
{
namespace bg = boost::geometry;
typedef typename bg::point_type<G2>::type P2;
typedef typename bg::point_type<G1>::type P1;
typedef typename bg::point_type<G1>::type mapper_point_type;
std::ofstream svg(filename.c_str(), std::ios::trunc);
bg::svg_mapper<P2> mapper(svg, 500, 500);
bg::svg_mapper<mapper_point_type> mapper(svg, 500, 500);
mapper.add(g1);
mapper.add(g2);

View File

@ -179,8 +179,10 @@ int test_main(int, char* [])
// FP/int mixed
test<i, f, double, int, double>();
test<s, f, double, short int, double>();
// integers
test<s, s, double, short int, short int>();
test<i, i, double, int, int>();
test<c, i, double, int, int>();
test<c, c, double, char, char>();