diff options
author | Benoit Jacob <jacob.benoit.1@gmail.com> | 2009-10-28 18:19:29 -0400 |
---|---|---|
committer | Benoit Jacob <jacob.benoit.1@gmail.com> | 2009-10-28 18:19:29 -0400 |
commit | 2840ac7e948ecb3c7b19ba8f581f829a4a4e1fea (patch) | |
tree | 14adcd3aa33c4207b14455707bc247cea29029e6 /test/geo_transformations.cpp | |
parent | 1f1c04cac1d8a87cbb34741d141df646b2da2827 (diff) |
big huge changes, so i dont remember everything.
* renaming, e.g. LU ---> FullPivLU
* split tests framework: more robust, e.g. dont generate empty tests if a number is skipped
* make all remaining tests use that splitting, as needed.
* Fix 4x4 inversion (see stable branch)
* Transform::inverse() and geo_transform test : adapt to new inverse() API, it was also trying to instantiate inverse() for 3x4 matrices.
* CMakeLists: more robust regexp to parse the version number
* misc fixes in unit tests
Diffstat (limited to 'test/geo_transformations.cpp')
-rw-r--r-- | test/geo_transformations.cpp | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/test/geo_transformations.cpp b/test/geo_transformations.cpp index 23b297314..f1d068b83 100644 --- a/test/geo_transformations.cpp +++ b/test/geo_transformations.cpp @@ -298,16 +298,19 @@ template<typename Scalar, int Mode> void transformations(void) VERIFY_IS_APPROX((t0 * v1).template start<3>(), AlignedScaling3(v0) * v1); // test transform inversion - if(Mode!=AffineCompact) - { - t0.setIdentity(); - t0.translate(v0); - t0.linear().setRandom(); - VERIFY_IS_APPROX(t0.inverse(Affine).matrix(), t0.matrix().inverse()); - t0.setIdentity(); - t0.translate(v0).rotate(q1); - VERIFY_IS_APPROX(t0.inverse(Isometry).matrix(), t0.matrix().inverse()); - } + t0.setIdentity(); + t0.translate(v0); + t0.linear().setRandom(); + Matrix4 t044 = Matrix4::Zero(); + t044(3,3) = 1; + t044.block(0,0,t0.matrix().rows(),4) = t0.matrix(); + VERIFY_IS_APPROX(t0.inverse(Affine).matrix(), t044.inverse().block(0,0,t0.matrix().rows(),4)); + t0.setIdentity(); + t0.translate(v0).rotate(q1); + t044 = Matrix4::Zero(); + t044(3,3) = 1; + t044.block(0,0,t0.matrix().rows(),4) = t0.matrix(); + VERIFY_IS_APPROX(t0.inverse(Isometry).matrix(), t044.inverse().block(0,0,t0.matrix().rows(),4)); // test extract rotation and aligned scaling // t0.setIdentity(); @@ -354,9 +357,8 @@ template<typename Scalar, int Mode> void transformations(void) void test_geo_transformations() { for(int i = 0; i < g_repeat; i++) { -// CALL_SUBTEST( transformations<float>() ); - CALL_SUBTEST(( transformations<double,Affine>() )); - CALL_SUBTEST(( transformations<double,AffineCompact>() )); - CALL_SUBTEST(( transformations<double,Projective>() )); + CALL_SUBTEST_1(( transformations<double,Affine>() )); + CALL_SUBTEST_2(( transformations<float,AffineCompact>() )); + CALL_SUBTEST_3(( transformations<double,Projective>() )); } } |