Adapted test Christoph to gcc which, for long double, also results in a polygon

[SVN r76889]
This commit is contained in:
Barend Gehrels 2012-02-04 21:50:01 +00:00
parent 22ba5b5dee
commit 5ba364a6ac
2 changed files with 13 additions and 6 deletions

View File

@ -886,15 +886,22 @@ void test_all(bool test_self_tangencies = true, bool test_mixed = false)
test_traverse<polygon, polygon, operation_union>::apply("geos_4",
1, 2304.41633605957,
geos_4[0], geos_4[1]);
if (! is_float)
{
// Calculate intersection/union of two triangles. Robustness case.
#if defined(_MSC_VER)
T const expected = if_typed_tt<T>(3.63794e-17, 0.0);
#else
T const expected = if_typed<T, long double>(2.77555756156289135106e-17, 0.0);
#endif
// Calculate intersection/union of two triangles. Robustness case.
// ttmath can form a very small intersection triangle
// (which is even not accomplished by SQL Server/PostGIS)
std::string const caseid = "ggl_list_20110820_christophe";
test_traverse<polygon, polygon, operation_intersection>::apply(caseid,
1, if_typed_tt<T>(3.63794e-17, 0.0),
1, expected,
ggl_list_20110820_christophe[0], ggl_list_20110820_christophe[1]);
test_traverse<polygon, polygon, operation_union>::apply(caseid,
1, 67.3550722317627,

View File

@ -111,11 +111,11 @@ template <typename T> struct string_from_type<boost::rational<T> >
#endif
template <typename CoordinateType, typename T>
inline T if_typed_tt(T value_tt, T value)
template <typename CoordinateType, typename T1, typename T2>
inline CoordinateType if_typed_tt(T1 value_tt, T2 value)
{
#if defined(HAVE_TTMATH)
return boost::is_same<CoordinateType, ttmath_big>::value ? value_tt : value;
return boost::is_same<CoordinateType, ttmath_big>::type::value ? value_tt : value;
#else
return value;
#endif