diff --git a/test/quaternion.cpp b/test/quaternion.cpp index 71394bd2..dfcf448d 100644 --- a/test/quaternion.cpp +++ b/test/quaternion.cpp @@ -131,5 +131,24 @@ main (void) } } + { + static struct { + float x, y, z; + cruft::quaternionf expected; + char const *msg; + } const TESTS[] = { + { 1.f, 2.f, 3.f, { -0.3688714f, 0.7549338f, -0.2061492f, 0.5015091f, }, "positive rotation", }, + }; + + for (auto const &t: TESTS) { + tap.expect_eq ( + cruft::quaternionf::from_euler ({ t.x, t.y, t.z }), + t.expected, + "from_euler: %!", + t.msg + ); + } + } + return tap.status (); }