aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/basicstuff.cpp
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2009-04-29 14:51:19 +0000
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2009-04-29 14:51:19 +0000
commit8b1e7c2792525ecc43f68ee42bf6af1473fd6699 (patch)
tree33634ddb489c769a2647758d70bd78a4078e3c49 /test/basicstuff.cpp
parente722f5538213c450a50b39475920d7c310efc229 (diff)
add cast<>() tests. including a vectorization_logic test that currently fails (casting to same type should not prevent vectorization)
Diffstat (limited to 'test/basicstuff.cpp')
-rw-r--r--test/basicstuff.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/basicstuff.cpp b/test/basicstuff.cpp
index 21473cf8a..c5336b802 100644
--- a/test/basicstuff.cpp
+++ b/test/basicstuff.cpp
@@ -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++) {