From 96464f8563720f09648876d7f268db6059615a19 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Fri, 20 May 2011 09:59:15 +0200 Subject: [PATCH] clean several other assertion checking tests --- test/geo_hyperplane.cpp | 5 +++-- test/geo_parametrizedline.cpp | 6 ++++-- test/geo_quaternion.cpp | 10 +++------- test/geo_transformations.cpp | 8 +++++--- test/map.cpp | 2 -- 5 files changed, 15 insertions(+), 16 deletions(-) diff --git a/test/geo_hyperplane.cpp b/test/geo_hyperplane.cpp index de3c6df0b..6916a1cdc 100644 --- a/test/geo_hyperplane.cpp +++ b/test/geo_hyperplane.cpp @@ -150,8 +150,9 @@ template void hyperplane_alignment() VERIFY_IS_APPROX(p1->coeffs(), p2->coeffs()); VERIFY_IS_APPROX(p1->coeffs(), p3->coeffs()); - #ifdef EIGEN_VECTORIZE - VERIFY_RAISES_ASSERT((::new(reinterpret_cast(array3u)) Plane3a)); + #if defined(EIGEN_VECTORIZE) && !defined(EIGEN_DONT_ALIGN_STATICALLY) + if(internal::packet_traits::Vectorizable) + VERIFY_RAISES_ASSERT((::new(reinterpret_cast(array3u)) Plane3a)); #endif } diff --git a/test/geo_parametrizedline.cpp b/test/geo_parametrizedline.cpp index 460455eec..6560ffcff 100644 --- a/test/geo_parametrizedline.cpp +++ b/test/geo_parametrizedline.cpp @@ -90,8 +90,9 @@ template void parametrizedline_alignment() VERIFY_IS_APPROX(p1->direction(), p2->direction()); VERIFY_IS_APPROX(p1->direction(), p3->direction()); - #ifdef EIGEN_VECTORIZE - VERIFY_RAISES_ASSERT((::new(reinterpret_cast(array3u)) Line4a)); + #if defined(EIGEN_VECTORIZE) && !defined(EIGEN_DONT_ALIGN_STATICALLY) + if(internal::packet_traits::Vectorizable) + VERIFY_RAISES_ASSERT((::new(reinterpret_cast(array3u)) Line4a)); #endif } @@ -100,6 +101,7 @@ void test_geo_parametrizedline() for(int i = 0; i < g_repeat; i++) { CALL_SUBTEST_1( parametrizedline(ParametrizedLine()) ); CALL_SUBTEST_2( parametrizedline(ParametrizedLine()) ); + CALL_SUBTEST_2( parametrizedline_alignment() ); CALL_SUBTEST_3( parametrizedline(ParametrizedLine()) ); CALL_SUBTEST_3( parametrizedline_alignment() ); CALL_SUBTEST_4( parametrizedline(ParametrizedLine,5>()) ); diff --git a/test/geo_quaternion.cpp b/test/geo_quaternion.cpp index c34e3bed6..b6f9690be 100644 --- a/test/geo_quaternion.cpp +++ b/test/geo_quaternion.cpp @@ -148,9 +148,7 @@ template void mapQuaternion(void){ VERIFY_IS_APPROX(q4.coeffs(), q3.coeffs()); #ifdef EIGEN_VECTORIZE if(internal::packet_traits::Vectorizable) - { VERIFY_RAISES_ASSERT((MQuaternionA(array3unaligned))); - } #endif } @@ -173,11 +171,9 @@ template void quaternionAlignment(void){ VERIFY_IS_APPROX(q1->coeffs(), q2->coeffs()); VERIFY_IS_APPROX(q1->coeffs(), q3->coeffs()); - #ifdef EIGEN_VECTORIZE + #if defined(EIGEN_VECTORIZE) && !defined(EIGEN_DONT_ALIGN_STATICALLY) if(internal::packet_traits::Vectorizable) - { VERIFY_RAISES_ASSERT((::new(reinterpret_cast(arrayunaligned)) QuaternionA)); - } #endif } @@ -201,8 +197,8 @@ void test_geo_quaternion() for(int i = 0; i < g_repeat; i++) { CALL_SUBTEST_1(( quaternion() )); CALL_SUBTEST_1( check_const_correctness(Quaternionf()) ); -// CALL_SUBTEST_2(( quaternion() )); -// CALL_SUBTEST_2( check_const_correctness(Quaterniond()) ); + CALL_SUBTEST_2(( quaternion() )); + CALL_SUBTEST_2( check_const_correctness(Quaterniond()) ); CALL_SUBTEST_3(( quaternion() )); CALL_SUBTEST_4(( quaternion() )); CALL_SUBTEST_5(( quaternionAlignment() )); diff --git a/test/geo_transformations.cpp b/test/geo_transformations.cpp index 67396498d..b9e9f8c8e 100644 --- a/test/geo_transformations.cpp +++ b/test/geo_transformations.cpp @@ -442,8 +442,9 @@ template void transform_alignment() VERIFY_IS_APPROX( (*p1) * (*p1), (*p2)*(*p3)); - #ifdef EIGEN_VECTORIZE - VERIFY_RAISES_ASSERT((::new(reinterpret_cast(array3u)) Projective3a)); + #if defined(EIGEN_VECTORIZE) && !defined(EIGEN_DONT_ALIGN_STATICALLY) + if(internal::packet_traits::Vectorizable) + VERIFY_RAISES_ASSERT((::new(reinterpret_cast(array3u)) Projective3a)); #endif } @@ -455,7 +456,8 @@ void test_geo_transformations() CALL_SUBTEST_2(( transformations() )); CALL_SUBTEST_2(( non_projective_only() )); - + CALL_SUBTEST_2(( transform_alignment() )); + CALL_SUBTEST_3(( transformations() )); CALL_SUBTEST_3(( transformations() )); CALL_SUBTEST_3(( transform_alignment() )); diff --git a/test/map.cpp b/test/map.cpp index 382d96b17..931ee5db6 100644 --- a/test/map.cpp +++ b/test/map.cpp @@ -51,9 +51,7 @@ template void map_class_vector(const VectorType& m) VERIFY_IS_EQUAL(ma1, ma3); #ifdef EIGEN_VECTORIZE if(internal::packet_traits::Vectorizable) - { VERIFY_RAISES_ASSERT((Map(array3unaligned, size))) - } #endif internal::aligned_delete(array1, size);