[test] avoid testing too much when one type is tested (compilation time)

This commit is contained in:
barendgehrels
2017-03-18 20:14:19 +01:00
parent 404bd889f5
commit 12b1ad9e79
5 changed files with 44 additions and 23 deletions

View File

@@ -131,30 +131,48 @@ std::string test_difference(std::string const& caseid, G1 const& g1, G2 const& g
typedef typename bg::coordinate_type<G1>::type coordinate_type;
boost::ignore_unused<coordinate_type>();
bg::model::multi_polygon<OutputType> result, result_s;
bg::model::multi_polygon<OutputType> result;
typedef typename bg::strategy::relate::services::default_strategy
<
G1, G2
>::type strategy_type;
if (sym)
{
bg::sym_difference(g1, g2, result);
bg::sym_difference(g1, g2, result_s, strategy_type());
}
else
{
bg::difference(g1, g2, result);
bg::difference(g1, g2, result_s, strategy_type());
}
if (settings.remove_spikes)
{
bg::remove_spikes(result);
bg::remove_spikes(result_s);
}
#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE)
{
bg::model::multi_polygon<OutputType> result_s;
typedef typename bg::strategy::relate::services::default_strategy
<
G1, G2
>::type strategy_type;
if (sym)
{
bg::sym_difference(g1, g2, result_s, strategy_type());
}
else
{
bg::difference(g1, g2, result_s, strategy_type());
}
if (settings.remove_spikes)
{
bg::remove_spikes(result_s);
}
BOOST_CHECK_EQUAL(bg::num_points(result), bg::num_points(result_s));
}
#endif
std::ostringstream return_string;
return_string << bg::wkt(result);
@@ -175,7 +193,8 @@ std::string test_difference(std::string const& caseid, G1 const& g1, G2 const& g
difference_output(caseid, g1, g2, result);
#ifndef BOOST_GEOMETRY_DEBUG_ASSEMBLE
#if ! (defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE) \
|| defined(BOOST_GEOMETRY_DEBUG_ASSEMBLE))
{
// Test inserter functionality
// Test if inserter returns output-iterator (using Boost.Range copy)
@@ -241,8 +260,6 @@ std::string test_difference(std::string const& caseid, G1 const& g1, G2 const& g
}
BOOST_CHECK_CLOSE(area, expected_area, settings.percentage);
BOOST_CHECK_EQUAL(bg::num_points(result), bg::num_points(result_s));
#endif

View File

@@ -170,9 +170,9 @@ typename bg::default_area_result<G1>::type test_intersection(std::string const&
}
typedef typename setop_output_type<OutputType>::type result_type;
typedef typename bg::point_type<G1>::type point_type;
#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE)
typedef typename bg::point_type<G1>::type point_type;
if (! settings.debug)
{
// Check _inserter behaviour with stratey

View File

@@ -94,7 +94,7 @@ void test_union(std::string const& caseid, G1 const& g1, G2 const& g2,
// Declare output (vector of rings or multi_polygon)
typedef typename setop_output_type<OutputType>::type result_type;
result_type clip, clip_s;
result_type clip;
#if defined(BOOST_GEOMETRY_DEBUG_ROBUSTNESS)
std::cout << "*** UNION " << caseid << std::endl;
@@ -108,12 +108,18 @@ void test_union(std::string const& caseid, G1 const& g1, G2 const& g2,
// Check normal behaviour
bg::union_(g1, g2, clip);
// Check strategy passed explicitly
typedef typename bg::strategy::intersection::services::default_strategy
<
typename bg::cs_tag<OutputType>::type
>::type strategy_type;
bg::union_(g1, g2, clip_s, strategy_type());
#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE)
{
// Check strategy passed explicitly
result_type clip_s;
typedef typename bg::strategy::intersection::services::default_strategy
<
typename bg::cs_tag<OutputType>::type
>::type strategy_type;
bg::union_(g1, g2, clip_s, strategy_type());
BOOST_CHECK_EQUAL(num_points(clip), num_points(clip_s));
}
#endif
typename bg::default_area_result<OutputType>::type area = 0;
std::size_t n = 0;
@@ -198,8 +204,6 @@ void test_union(std::string const& caseid, G1 const& g1, G2 const& g2,
BOOST_CHECK_CLOSE(area, expected_area, settings.percentage);
BOOST_CHECK_EQUAL(num_points(clip), num_points(clip_s));
#if defined(TEST_WITH_SVG)
{
bool const ccw =

View File

@@ -484,13 +484,13 @@ void test_all()
test_areal<ring, polygon>();
#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE)
// Open
test_areal<bg::model::ring<P, true, false>, bg::model::polygon<P, true, false> >();
// Counter clockwise
test_areal<bg::model::ring<P, false>, bg::model::polygon<P, false> >();
#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE)
// Counter clockwise and open
test_areal<bg::model::ring<P, false, false>, bg::model::polygon<P, false, false> >();
#endif

View File

@@ -425,11 +425,11 @@ void test_specific()
int test_main(int, char* [])
{
test_all<bg::model::d2::point_xy<double>, true, true>();
#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE)
test_all<bg::model::d2::point_xy<double>, false, false>();
test_specific<bg::model::d2::point_xy<int>, false, false>();
#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE)
test_all<bg::model::d2::point_xy<float>, true, true>();
#if defined(HAVE_TTMATH)