add cast<>() tests. including a vectorization_logic test that currently fails (casting to same type should not prevent vectorization)

This commit is contained in:
Benoit Jacob
2009-04-29 14:51:19 +00:00
parent e722f55382
commit 8b1e7c2792
2 changed files with 12 additions and 0 deletions

View File

@@ -109,6 +109,15 @@ template<typename MatrixType> void basicStuff(const MatrixType& m)
}
}
void casting()
{
Matrix4f m = Matrix4f::Random(), m2;
Matrix4d n = m.cast<double>();
VERIFY(m.isApprox(n.cast<float>()));
m2 = m.cast<float>(); // check the specialization when NewType == Type
VERIFY(m.isApprox(m2));
}
void test_basicstuff()
{
for(int i = 0; i < g_repeat; i++) {