quaternion: add test for from_euler
This commit is contained in:
parent
16f460a2d2
commit
5251c9b071
@ -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 ();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user