1 /**
2 * SFCGAL
3 *
4 * Copyright (C) 2012-2013 Oslandia <infos@oslandia.com>
5 * Copyright (C) 2012-2013 IGN (http://www.ign.fr)
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
16
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
19 */
20 #include <boost/test/unit_test.hpp>
21
22 #include <SFCGAL/detail/ComplexComparator.h>
23 #include <SFCGAL/numeric.h>
24
25 using namespace SFCGAL ;
26 using namespace SFCGAL::detail ;
27
28 // always after CGAL
29 using namespace boost::unit_test ;
30
31
32 BOOST_AUTO_TEST_SUITE( SFCGAL_detail_ComplexComparatorTest )
33
BOOST_AUTO_TEST_CASE(testComparator)34 BOOST_AUTO_TEST_CASE( testComparator )
35 {
36 ComplexComparator less ;
37
38 BOOST_CHECK( ! less( std::complex< double >( 1.0,0.0 ), std::complex< double >( 0.0,0.0 ) ) );
39 BOOST_CHECK( ! less( std::complex< double >( 0.0,0.0 ), std::complex< double >( 0.0,0.0 ) ) );
40 BOOST_CHECK( less( std::complex< double >( 0.0,0.0 ), std::complex< double >( 1.0,0.0 ) ) );
41 BOOST_CHECK( less( std::complex< double >( 0.0,0.0 ), std::complex< double >( 0.0,1.0 ) ) );
42 }
43
44 BOOST_AUTO_TEST_SUITE_END()
45
46