Fix swap test for size 1 inputs.

This commit is contained in:
Antonio Sánchez 2022-03-10 15:05:58 +00:00
parent 7882408856
commit baf9a985ec

View File

@ -24,10 +24,13 @@ struct other_matrix_type<Matrix<Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCo
template <typename MatrixType> template <typename MatrixType>
typename internal::enable_if<(MatrixType::RowsAtCompileTime==1 || MatrixType::RowsAtCompileTime==Dynamic), void>::type typename internal::enable_if<(MatrixType::RowsAtCompileTime==1 || MatrixType::RowsAtCompileTime==Dynamic), void>::type
check_row_swap(MatrixType& m1) { check_row_swap(MatrixType& m1) {
// test assertion on mismatching size -- matrix case
VERIFY_RAISES_ASSERT(m1.swap(m1.row(0))); if (m1.rows() != 1) {
// test assertion on mismatching size -- xpr case // test assertion on mismatching size -- matrix case
VERIFY_RAISES_ASSERT(m1.row(0).swap(m1)); VERIFY_RAISES_ASSERT(m1.swap(m1.row(0)));
// test assertion on mismatching size -- xpr case
VERIFY_RAISES_ASSERT(m1.row(0).swap(m1));
}
} }
template <typename MatrixType> template <typename MatrixType>