From d343c0d9f3f46317a4a2dc811963464dab46f3e8 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 4 Mar 2021 19:07:04 +0000 Subject: Test rotation funcs with a huge range of random values --- test/test-maths.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/test-maths.cpp b/test/test-maths.cpp index b66b863..ea60f2a 100644 --- a/test/test-maths.cpp +++ b/test/test-maths.cpp @@ -114,13 +114,17 @@ compare_rotations(float a, const glm::vec3 & axis, glm::mat4 (*rotate_func)(floa } } } -const auto angs = boost::unit_test::data::make({pi, half_pi, two_pi, quarter_pi, -pi, -half_pi, -quarter_pi, 0.F}); + +const auto angs = boost::unit_test::data::make({pi, half_pi, two_pi, quarter_pi, -pi, -half_pi, -quarter_pi, 0.F}) + * boost::unit_test::data::make(0); +const auto random_angs = boost::unit_test::data::random(-two_pi, two_pi) ^ boost::unit_test::data::xrange(1000); const auto rots = boost::unit_test::data::make>({ {up, rotate_yaw, "yaw"}, {west, rotate_pitch, "pitch"}, {north, rotate_roll, "roll"}, }); -BOOST_DATA_TEST_CASE(test_rotations, angs * rots, a, ax, func, n) +BOOST_DATA_TEST_CASE(test_rotations, (angs + random_angs) * rots, a, ai, ax, func, n) { + (void)ai; compare_rotations(a, ax, func, n); } -- cgit v1.2.3