aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/swap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/swap.cpp')
-rw-r--r--test/swap.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/swap.cpp b/test/swap.cpp
index 36b353148..dc3610085 100644
--- a/test/swap.cpp
+++ b/test/swap.cpp
@@ -41,9 +41,15 @@ template<typename MatrixType> void swap(const MatrixType& m)
OtherMatrixType m3_copy = m3;
// test swapping 2 matrices of same type
+ Scalar *d1=m1.data(), *d2=m2.data();
m1.swap(m2);
VERIFY_IS_APPROX(m1,m2_copy);
VERIFY_IS_APPROX(m2,m1_copy);
+ if(MatrixType::SizeAtCompileTime==Dynamic)
+ {
+ VERIFY(m1.data()==d2);
+ VERIFY(m2.data()==d1);
+ }
m1 = m1_copy;
m2 = m2_copy;