9 #include <boost/test/data/test_case.hpp>
10 #include <boost/test/tools/output_test_stream.hpp>
11 #include <boost/test/unit_test.hpp>
26 namespace utf = boost::unit_test;
27 const double inf = std::numeric_limits<double>::infinity();
34 for (
const auto&
i :
v) {
35 std::cout <<
"(" <<
i[0] <<
", " <<
i[1] <<
")" << std::endl;
39 const double dif0 = std::abs(a[0] - b[0]);
40 const double dif1 = std::abs(a[1] - b[1]);
41 const double tol = 1
e-9;
42 return ((dif0 < tol) and (dif1 < tol));
44 BOOST_AUTO_TEST_SUITE(Surfaces)
50 BOOST_CHECK_EQUAL(twentyByTenRectangle.
type(),
54 const double zeroHalfX(0.), zeroHalfY(0.);
55 const double infHalfX(
inf), infHalfY(
inf);
59 BOOST_CHECK_EQUAL(zeroDimensionsRectangle.
type(),
72 auto valvector = original.
values();
73 std::array<double, RectangleBounds::eSize>
values{};
76 BOOST_CHECK_EQUAL(original, recreated);
101 const std::vector<Vector2> coords = {
102 {-10., -5.}, {10., -5.}, {10., 5.}, {-10., 5.}};
105 BOOST_CHECK_EQUAL_COLLECTIONS(coords.cbegin(), coords.cend(),
107 const Vector2 pointA{1.0, 1.0};
110 BOOST_CHECK(rect.
inside(pointA, bcheck));
117 const auto originalVertices = rectA.
vertices();
118 const auto assignedVertices = rectB.
vertices();
119 BOOST_CHECK_EQUAL_COLLECTIONS(
120 originalVertices.cbegin(), originalVertices.cend(),
121 assignedVertices.cbegin(), assignedVertices.cend());
124 BOOST_AUTO_TEST_SUITE_END()