aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/swap.cpp
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2014-11-06 09:25:26 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2014-11-06 09:25:26 +0100
commit722916e19d86b224ec6c705e24d376def524154b (patch)
treef68ce5ba93b0ab12fbd838e6254b99086730901c /test/swap.cpp
parentc6fefe5d8e3eda8af05c7dcb278551598dbb5d8e (diff)
bug #903: clean swap API regarding extra enable_if parameters, and add failtests for swap
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;