diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2018-11-12 06:42:35 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2018-11-12 06:42:35 +0100 |
commit | 407b6208604d2822b1067ac64949e78a9167572b (patch) | |
tree | 8e4371deef2804e77e2fe6e17158be2536de28da /eigen/test/ref.cpp | |
parent | ca2e0fcdcfff03747500344e2522ff330ccafa14 (diff) |
eigen update
Diffstat (limited to 'eigen/test/ref.cpp')
-rw-r--r-- | eigen/test/ref.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/eigen/test/ref.cpp b/eigen/test/ref.cpp index 769db04..9dd2c04 100644 --- a/eigen/test/ref.cpp +++ b/eigen/test/ref.cpp @@ -13,7 +13,7 @@ #endif #define TEST_ENABLE_TEMPORARY_TRACKING - +#define TEST_CHECK_STATIC_ASSERTIONS #include "main.h" // test Ref.h @@ -255,6 +255,17 @@ void test_ref_overloads() test_ref_ambiguous(A, B); } +void test_ref_fixed_size_assert() +{ + Vector4f v4; + VectorXf vx(10); + VERIFY_RAISES_STATIC_ASSERT( Ref<Vector3f> y = v4; (void)y; ); + VERIFY_RAISES_STATIC_ASSERT( Ref<Vector3f> y = vx.head<4>(); (void)y; ); + VERIFY_RAISES_STATIC_ASSERT( Ref<const Vector3f> y = v4; (void)y; ); + VERIFY_RAISES_STATIC_ASSERT( Ref<const Vector3f> y = vx.head<4>(); (void)y; ); + VERIFY_RAISES_STATIC_ASSERT( Ref<const Vector3f> y = 2*v4; (void)y; ); +} + void test_ref() { for(int i = 0; i < g_repeat; i++) { @@ -277,4 +288,5 @@ void test_ref() } CALL_SUBTEST_7( test_ref_overloads() ); + CALL_SUBTEST_7( test_ref_fixed_size_assert() ); } |