diff --git a/Polynomial/include/CGAL/Test/_test_polynomial_traits_d.h b/Polynomial/include/CGAL/Test/_test_polynomial_traits_d.h index f8e70b420a5..b9d354b0f13 100644 --- a/Polynomial/include/CGAL/Test/_test_polynomial_traits_d.h +++ b/Polynomial/include/CGAL/Test/_test_polynomial_traits_d.h @@ -36,13 +36,11 @@ static CGAL::Random my_rnd(346); // some seed #define ASSERT_IS_NULL_FUNCTOR(T) \ BOOST_STATIC_ASSERT((boost::is_same::value)) - - template Polynomial_d_ -generate_sparse_random_polynomial(int max_degree = 10){ +generate_sparse_random_polynomial_(int max_degree = 10){ typedef CGAL::Polynomial_traits_d PT; CGAL_SNAP_CGALi_TRAITS_D(PT); typedef typename PT::Construct_polynomial Constructor; @@ -72,6 +70,19 @@ generate_sparse_random_polynomial(int max_degree = 10){ return result; } +// generates a random polynomial that contains at least one coefficient +// that effects the outer most variable. +// Several test in this file rely on this fact. +// The other case is usually handled as a special case. +template +Polynomial_d_ +generate_sparse_random_polynomial(int max_degree = 10){ + Polynomial_d_ p; + while(p.degree()==0){ + p = generate_sparse_random_polynomial_(max_degree); + } + return p; +} template class Construct_test_polynomial { CGAL_SNAP_CGALi_TRAITS_D(Polynomial_traits_d)