added test of double interoperability in arithmetic operators.

This commit is contained in:
Michael Hemmer 2008-08-01 12:42:01 +00:00
parent a46a1883fa
commit d2ee3a1eb3
1 changed files with 9 additions and 0 deletions

View File

@ -15,6 +15,8 @@
# include <CGAL/leda_integer.h>
#endif
// template class CGAL::Quotient<CGAL::Gmpz>;
template < typename T >
void test_double_ctor()
{
@ -26,6 +28,13 @@ void test_double_ctor()
assert(q1.numerator() == T(d1));
assert(q2.numerator() == 1);
assert(q2.denominator() == 2);
// though not exact, implicit operations +,-,* with double
// should be the exactly the same as via explicit ctor!
assert( (q1+0.3) == (q1+Qt(0.3)));
assert( (q1-0.3) == (q1-Qt(0.3)));
assert( (q1*0.3) == (q1*Qt(0.3)));
assert( (q1/0.3) == (q1/Qt(0.3)));
}
void test_comparison_operators()