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);
86 BOOST_TEST_DECORATOR(*utf::tolerance(1
e-10))
96 const std::vector<Vector2D> coords = {
97 {-10., -5.}, {10., -5.}, {10., 5.}, {-10., 5.}};
100 BOOST_CHECK_EQUAL_COLLECTIONS(coords.cbegin(), coords.cend(),
102 const Vector2D pointA{1.0, 1.0}, pointB{9.0, 1.0}, outside{10.1, 5.1};
108 BOOST_CHECK(rect.
inside(pointA, bcheck));
115 const auto originalVertices = rectA.
vertices();
116 const auto assignedVertices = rectB.
vertices();
117 BOOST_CHECK_EQUAL_COLLECTIONS(
118 originalVertices.cbegin(), originalVertices.cend(),
119 assignedVertices.cbegin(), assignedVertices.cend());
122 BOOST_AUTO_TEST_SUITE_END()