diff --git a/test/unit/SFCGAL/algorithm/LineSegmentTest.cpp b/test/unit/SFCGAL/algorithm/LineSegmentTest.cpp new file mode 100644 index 00000000..ae3eedaf --- /dev/null +++ b/test/unit/SFCGAL/algorithm/LineSegmentTest.cpp @@ -0,0 +1,47 @@ +/** + * SFCGAL + * + * Copyright (C) 2012-2020 Oslandia + * Copyright (C) 2012-2020 IGN (http://www.ign.fr) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, see . + */ + +// Boost +#include + +// SFCGAL +#include +#include +#include +#include + +using namespace boost::unit_test ; +using namespace SFCGAL ; + +BOOST_AUTO_TEST_SUITE( SFCGAL_algorithm_LengthSegmentTest ) + +BOOST_AUTO_TEST_CASE( testZeroLength ) +{ + std::unique_ptr result = algorithm::lineSegment( *io::readWkt( "LINESTRING Z(0 0 0, 0 0 10)" ) + , 0.3 + , 0.7 + ); + std::unique_ptr expected = io::readWkt( "LINESTRING Z(0 0 3, 0 0 7)" ); + + BOOST_CHECK( algorithm::covers3D( *result, *expected ) ); +} + +BOOST_AUTO_TEST_SUITE_END() +