summaryrefslogtreecommitdiff
path: root/test/test-maths.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-03-04 19:07:04 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2021-03-04 19:07:04 +0000
commitd343c0d9f3f46317a4a2dc811963464dab46f3e8 (patch)
tree589a96e03751052e52b78002847c1117cf9aa8ee /test/test-maths.cpp
parentSimplify a lot of code with sincosf (diff)
downloadilt-d343c0d9f3f46317a4a2dc811963464dab46f3e8.tar.bz2
ilt-d343c0d9f3f46317a4a2dc811963464dab46f3e8.tar.xz
ilt-d343c0d9f3f46317a4a2dc811963464dab46f3e8.zip
Test rotation funcs with a huge range of random values
Diffstat (limited to 'test/test-maths.cpp')
-rw-r--r--test/test-maths.cpp8
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);
}