9 #include <boost/test/data/test_case.hpp>
10 #include <boost/test/tools/output_test_stream.hpp>
11 #include <boost/test/unit_test.hpp>
21 namespace utf = boost::unit_test;
22 const double inf = std::numeric_limits<double>::infinity();
29 for (
const auto& i :
v) {
30 std::cout <<
"(" << i[0] <<
", " << i[1] <<
")" << std::endl;
34 const double dif0 =
std::abs(a[0] - b[0]);
35 const double dif1 =
std::abs(a[1] - b[1]);
36 const double tol = 1
e-9;
37 return ((dif0 < tol) and (dif1 < tol));
39 BOOST_AUTO_TEST_SUITE(Surfaces)
45 BOOST_CHECK_EQUAL(twentyByTenRectangle.
type(),
49 const double zeroHalfX(0.), zeroHalfY(0.);
50 const double infHalfX(
inf), infHalfY(
inf);
54 BOOST_CHECK_EQUAL(zeroDimensionsRectangle.
type(),
67 auto valvector = original.
values();
68 std::array<double, RectangleBounds::eSize>
values;
71 BOOST_CHECK_EQUAL(original, recreated);
96 const std::vector<Vector2D> coords = {
97 {-10., -5.}, {10., -5.}, {10., 5.}, {-10., 5.}};
100 BOOST_CHECK_EQUAL_COLLECTIONS(coords.cbegin(), coords.cend(),
105 BOOST_CHECK(rect.
inside(pointA, bcheck));
112 const auto originalVertices = rectA.
vertices();
113 const auto assignedVertices = rectB.
vertices();
114 BOOST_CHECK_EQUAL_COLLECTIONS(
115 originalVertices.cbegin(), originalVertices.cend(),
116 assignedVertices.cbegin(), assignedVertices.cend());
119 BOOST_AUTO_TEST_SUITE_END()