aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/block.cpp
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2017-01-23 22:06:08 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2017-01-23 22:06:08 +0100
commitba3f977946ed0ac5dde82a15a9c11784513155f2 (patch)
tree0957843366137775716aed69feb8bf59c43b2b79 /test/block.cpp
parentb0db4eff367017f8b273b7d407b3fe0e86808ed2 (diff)
bug #1376: add missing assertion on size mismatch with compound assignment operators (e.g., mat += mat.col(j))
Diffstat (limited to 'test/block.cpp')
-rw-r--r--test/block.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/block.cpp b/test/block.cpp
index 1eeb2da27..39565af83 100644
--- a/test/block.cpp
+++ b/test/block.cpp
@@ -186,6 +186,14 @@ template<typename MatrixType> void block(const MatrixType& m)
VERIFY_IS_EQUAL( (m1.template block<1,Dynamic>(0,1,1,0)), m1.block(0,1,1,0));
VERIFY_IS_EQUAL( ((m1*1).template block<Dynamic,1>(1,0,0,1)), m1.block(1,0,0,1));
VERIFY_IS_EQUAL( ((m1*1).template block<1,Dynamic>(0,1,1,0)), m1.block(0,1,1,0));
+
+ if (rows>=2 && cols>=2)
+ {
+ VERIFY_RAISES_ASSERT( m1 += m1.col(0) );
+ VERIFY_RAISES_ASSERT( m1 -= m1.col(0) );
+ VERIFY_RAISES_ASSERT( m1.array() *= m1.col(0).array() );
+ VERIFY_RAISES_ASSERT( m1.array() /= m1.col(0).array() );
+ }
}