9 #include <boost/test/tools/output_test_stream.hpp>
10 #include <boost/test/unit_test.hpp>
22 using boost::test_tools::output_test_stream;
27 BOOST_AUTO_TEST_SUITE(Utilities)
31 using Vector2F = Eigen::Matrix<float, 2, 1>;
34 Frustum2f2 fr({1, 0}, {0, 2}, M_PI / 2.);
36 BOOST_CHECK_EQUAL(fr.origin(),
Vector2F(1, 0));
39 const auto& normals = fr.normals();
40 BOOST_CHECK_EQUAL(normals.size(), 3
u);
42 fr.svg(output, 200, 200);
43 BOOST_CHECK(!output.is_empty(
true));
45 using Vector3F = Eigen::Matrix<float, 3, 1>;
48 Frustum3f3 fr33({1, 0, 0}, {0, 2, 1}, M_PI / 2.);
50 BOOST_CHECK_EQUAL(fr33.origin(),
Vector3F(1, 0, 0));
53 const auto& normals33 = fr33.normals();
54 BOOST_CHECK_EQUAL(normals33.size(), 4
u);
61 Frustum3f4 fr34({1, 0, 0}, {0, 2, 1}, M_PI / 2.);
63 BOOST_CHECK_EQUAL(fr34.origin(),
Vector3F(1, 0, 0));
66 const auto& normals34 = fr34.normals();
67 BOOST_CHECK_EQUAL(normals34.size(), 5
u);
71 BOOST_AUTO_TEST_SUITE_END()