aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/indexed_view.cpp
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2017-01-17 17:10:16 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2017-01-17 17:10:16 +0100
commit5e36ec3b6f3cf5513357e8520230083ff9ecb938 (patch)
treec2e3cabb3324aa4d3dffc328a00bb7fb100855c5 /test/indexed_view.cpp
parentf7852c3d16b7a5636dd8e0603b30034a06c80ac8 (diff)
Fix regression when passing enums to operator()
Diffstat (limited to 'test/indexed_view.cpp')
-rw-r--r--test/indexed_view.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/indexed_view.cpp b/test/indexed_view.cpp
index d4d82c54d..3ea8e7c00 100644
--- a/test/indexed_view.cpp
+++ b/test/indexed_view.cpp
@@ -277,6 +277,16 @@ void check_indexed_view()
VERIFY_IS_APPROX( A(legacy::seq(legacy::last,2,-2), legacy::seq(legacy::last-6,7)), A(seq(last,2,-2), seq(last-6,7)) );
VERIFY_IS_APPROX( A(seqN(legacy::last,2,-2), seqN(legacy::last-6,3)), A(seqN(last,2,-2), seqN(last-6,3)) );
+ // check mat(i,j) with weird types for i and j
+ {
+ VERIFY_IS_APPROX( A(B.RowsAtCompileTime-1, 1), A(3,1) );
+ VERIFY_IS_APPROX( A(B.RowsAtCompileTime, 1), A(3,1) );
+ VERIFY_IS_APPROX( A(B.RowsAtCompileTime-1, B.ColsAtCompileTime-1), A(3,3) );
+ VERIFY_IS_APPROX( A(B.RowsAtCompileTime, B.ColsAtCompileTime), A(3,3) );
+ enum { I = 3, J = 4 };
+ VERIFY_IS_APPROX( A(I,J), A(3,4) );
+ }
+
// check extended block API
{
VERIFY( is_same_eq( A.block<3,4>(1,1), A.block(1,1,fix<3>,fix<4>)) );