aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorGravatar Niall Murphy <nmurphy@snap.com>2021-05-10 11:43:49 +0100
committerGravatar Rasmus Munk Larsen <rmlarsen@google.com>2021-05-20 23:17:02 +0000
commit391094c50743f28f9174f455661f650bf07e0177 (patch)
tree305b2a012ba1ebb39b6491f0c6df4d134319e7c0 /test
parent8877f8d9b2631301ba070d645cdc3fc9b9f764f5 (diff)
Use derived object type in conservative_resize_like_impl
When calling conservativeResize() on a matrix with DontAlign flag, the temporary variable used to perform the resize should have the same Options as the original matrix to ensure that the correct override of swap is called (i.e. PlainObjectBase::swap(DenseBase<OtherDerived> & other). Calling the base class swap (i.e in DenseBase) results in assertions errors or memory corruption.
Diffstat (limited to 'test')
-rw-r--r--test/conservative_resize.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/conservative_resize.cpp b/test/conservative_resize.cpp
index 5dc500068..d709e3346 100644
--- a/test/conservative_resize.cpp
+++ b/test/conservative_resize.cpp
@@ -148,6 +148,7 @@ EIGEN_DECLARE_TEST(conservative_resize)
CALL_SUBTEST_4((run_matrix_tests<std::complex<float>, Eigen::ColMajor>()));
CALL_SUBTEST_5((run_matrix_tests<std::complex<double>, Eigen::RowMajor>()));
CALL_SUBTEST_5((run_matrix_tests<std::complex<double>, Eigen::ColMajor>()));
+ CALL_SUBTEST_1((run_matrix_tests<int, Eigen::RowMajor | Eigen::DontAlign>()));
CALL_SUBTEST_1((run_vector_tests<int>()));
CALL_SUBTEST_2((run_vector_tests<float>()));