00001 #include <CGAL/Cartesian.h>
00002 #include <CEP/core_expr.h>
00003
00004 #include "set_point.h"
00005 #include "tester.h"
00006
00007
00008
00009 typedef CGAL::Cartesian<double> R_car_dbl;
00010 typedef CGAL::Cartesian<CORE::Expr> R_car_cor;
00011
00012
00013
00014 bool is_unit_denom( R_car_dbl* dummy ) { return true; }
00015 bool is_unit_denom( R_car_cor* dummy ) { return true; }
00016
00017
00018
00019 template <typename R_test>
00020 class set_point_test : public CppUnit::TestCase
00021 {
00022 double x, y, z;
00023
00024 public:
00025
00026 void setUp()
00027 {
00028 x = 2./3.;
00029 y = 0.3;
00030 z = -7.8;
00031 }
00032
00033
00034 void t_assign()
00035 {
00036 CGAL::Point_3<R_test> p;
00037
00038 set_point(p, x,y,z );
00039
00040 CPPUNIT_ASSERT_EQUAL( x, CGAL::to_double( p.x() ));
00041 CPPUNIT_ASSERT_EQUAL( y, CGAL::to_double( p.y() ));
00042 CPPUNIT_ASSERT_EQUAL( z, CGAL::to_double( p.z() ));
00043
00044 CPPUNIT_ASSERT_EQUAL( is_unit_denom(new R_test()),
00045 CGAL::to_double(p.hw()) == 1 );
00046 }
00047
00048
00049 CPPUNIT_TEST_SUITE( set_point_test<R_test> );
00050 CPPUNIT_TEST( t_assign );
00051 CPPUNIT_TEST_SUITE_END();
00052 };
00053
00054
00055
00056 CPPUNIT_TEST_SUITE_REGISTRATION( set_point_test<R_car_dbl> );
00057 CPPUNIT_TEST_SUITE_REGISTRATION( set_point_test<R_car_cor> );
00058
00059