diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-03-04 19:07:04 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-03-04 19:07:04 +0000 |
commit | d343c0d9f3f46317a4a2dc811963464dab46f3e8 (patch) | |
tree | 589a96e03751052e52b78002847c1117cf9aa8ee | |
parent | Simplify a lot of code with sincosf (diff) | |
download | ilt-d343c0d9f3f46317a4a2dc811963464dab46f3e8.tar.bz2 ilt-d343c0d9f3f46317a4a2dc811963464dab46f3e8.tar.xz ilt-d343c0d9f3f46317a4a2dc811963464dab46f3e8.zip |
Test rotation funcs with a huge range of random values
-rw-r--r-- | test/test-maths.cpp | 8 |
1 files 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<std::tuple<glm::vec3, glm::mat4 (*)(float), std::string_view>>({ {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); } |