<commit_before>#include <CGAL/Cartesian.h>

typedef CGAL::Cartesian< double >  Kernel ;

#include <SFCGAL/Point.h>

#include <boost/test/unit_test.hpp>
using namespace boost::unit_test ;

using namespace SFCGAL ;

BOOST_AUTO_TEST_SUITE( SFCGAL_PointTest )

BOOST_AUTO_TEST_CASE( defaultConstructor )
{
	Point g;
	BOOST_CHECK( g.isEmpty() ) ;
	BOOST_CHECK( ! g.is3D() );

	BOOST_CHECK( isNaN( g.x() ) );
	BOOST_CHECK( isNaN( g.y() ) );
	BOOST_CHECK( isNaN( g.z() ) );
}


BOOST_AUTO_TEST_CASE( xyConstructor )
{
	Point g(2.0,3.0);
	BOOST_CHECK( ! g.isEmpty() ) ;
	BOOST_CHECK( ! g.is3D() );
	BOOST_CHECK_EQUAL( g.x(), 2.0 );
	BOOST_CHECK_EQUAL( g.y(), 3.0 );

	BOOST_CHECK( ! isNaN( g.x() ) );
	BOOST_CHECK( ! isNaN( g.y() ) );
	BOOST_CHECK( isNaN( g.z() ) );
}
BOOST_AUTO_TEST_CASE( xyzConstructor )
{
	Point g(2.0,3.0,4.0);
	BOOST_CHECK( ! g.isEmpty() ) ;
	BOOST_CHECK( g.is3D() );
	BOOST_CHECK_EQUAL( g.x(), 2.0 );
	BOOST_CHECK_EQUAL( g.y(), 3.0 );
	BOOST_CHECK_EQUAL( g.z(), 4.0 );
}


//-- toVector_2

BOOST_AUTO_TEST_CASE( emptyToVector_2 )
{
	Point g ;
	CGAL::Vector_2< Kernel > p = g.toVector_2< Kernel >();
	BOOST_CHECK_EQUAL( p.x(), 0.0 );
	BOOST_CHECK_EQUAL( p.y(), 0.0 );
	BOOST_CHECK_EQUAL( g.asText(1), "POINT EMPTY" );
}

BOOST_AUTO_TEST_CASE( xyToVector_2 )
{
	Point g( 3.0, 4.0 );
	CGAL::Vector_2< Kernel > p = g.toVector_2< Kernel >();
	BOOST_CHECK_EQUAL( p.x(), 3.0 );
	BOOST_CHECK_EQUAL( p.y(), 4.0 );
	BOOST_CHECK_EQUAL( g.asText(1), "POINT EMPTY" );
}

BOOST_AUTO_TEST_CASE( xyToVector_3 )
{
	Point g( 3.0, 4.0 );
	CGAL::Vector_3< Kernel > p = g.toVector_3< Kernel >();
	BOOST_CHECK_EQUAL( p.x(), 3.0 );
	BOOST_CHECK_EQUAL( p.y(), 4.0 );
	BOOST_CHECK_EQUAL( p.z(), 0.0 );
	BOOST_CHECK_EQUAL( g.asText(1), "POINT EMPTY" );
}


//-- asText

BOOST_AUTO_TEST_CASE( asTextEmpty )
{
	Point g;
	BOOST_CHECK_EQUAL( g.asText(1), "POINT EMPTY" );
}

BOOST_AUTO_TEST_CASE( asText2d )
{
	Point g(2.0,3.0);<commit_msg>correct last tests<commit_after>#include <CGAL/Cartesian.h>

typedef CGAL::Cartesian< double >  Kernel ;

#include <SFCGAL/Point.h>

#include <boost/test/unit_test.hpp>
using namespace boost::unit_test ;

using namespace SFCGAL ;

BOOST_AUTO_TEST_SUITE( SFCGAL_PointTest )

BOOST_AUTO_TEST_CASE( defaultConstructor )
{
	Point g;
	BOOST_CHECK( g.isEmpty() ) ;
	BOOST_CHECK( ! g.is3D() );

	BOOST_CHECK( isNaN( g.x() ) );
	BOOST_CHECK( isNaN( g.y() ) );
	BOOST_CHECK( isNaN( g.z() ) );
}


BOOST_AUTO_TEST_CASE( xyConstructor )
{
	Point g(2.0,3.0);
	BOOST_CHECK( ! g.isEmpty() ) ;
	BOOST_CHECK( ! g.is3D() );
	BOOST_CHECK_EQUAL( g.x(), 2.0 );
	BOOST_CHECK_EQUAL( g.y(), 3.0 );

	BOOST_CHECK( ! isNaN( g.x() ) );
	BOOST_CHECK( ! isNaN( g.y() ) );
	BOOST_CHECK( isNaN( g.z() ) );
}
BOOST_AUTO_TEST_CASE( xyzConstructor )
{
	Point g(2.0,3.0,4.0);
	BOOST_CHECK( ! g.isEmpty() ) ;
	BOOST_CHECK( g.is3D() );
	BOOST_CHECK_EQUAL( g.x(), 2.0 );
	BOOST_CHECK_EQUAL( g.y(), 3.0 );
	BOOST_CHECK_EQUAL( g.z(), 4.0 );
}


//-- toVector_2

BOOST_AUTO_TEST_CASE( emptyToVector_2 )
{
	Point g ;
	CGAL::Vector_2< Kernel > p = g.toVector_2< Kernel >();
	BOOST_CHECK_EQUAL( p.x(), 0.0 );
	BOOST_CHECK_EQUAL( p.y(), 0.0 );
}

BOOST_AUTO_TEST_CASE( xyToVector_2 )
{
	Point g( 3.0, 4.0 );
	CGAL::Vector_2< Kernel > p = g.toVector_2< Kernel >();
	BOOST_CHECK_EQUAL( p.x(), 3.0 );
	BOOST_CHECK_EQUAL( p.y(), 4.0 );
}

BOOST_AUTO_TEST_CASE( xyToVector_3 )
{
	Point g( 3.0, 4.0 );
	CGAL::Vector_3< Kernel > p = g.toVector_3< Kernel >();
	BOOST_CHECK_EQUAL( p.x(), 3.0 );
	BOOST_CHECK_EQUAL( p.y(), 4.0 );
	BOOST_CHECK_EQUAL( p.z(), 0.0 );
}


//-- asText

BOOST_AUTO_TEST_CASE( asTextEmpty )
{
	Point g;
	BOOST_CHECK_EQUAL( g.asText(1), "POINT EMPTY" );
}

BOOST_AUTO_TEST_CASE( asText2d )
{
	Point g(2.0,3.0);
{'fraction_non_alphanumeric': 0.18640410035068788, 'fraction_numerical': 0.03371998920960345, 'mean_word_length': 4.207865168539326, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4016008', 'n_tokens_mistral': 1804, 'n_tokens_neox': 1692, 'n_words': 295}