diff --git a/test/swap.cpp b/test/swap.cpp index 6189f1372..438835f3c 100644 --- a/test/swap.cpp +++ b/test/swap.cpp @@ -24,10 +24,13 @@ struct other_matrix_type typename internal::enable_if<(MatrixType::RowsAtCompileTime==1 || MatrixType::RowsAtCompileTime==Dynamic), void>::type check_row_swap(MatrixType& m1) { - // test assertion on mismatching size -- matrix case - VERIFY_RAISES_ASSERT(m1.swap(m1.row(0))); - // test assertion on mismatching size -- xpr case - VERIFY_RAISES_ASSERT(m1.row(0).swap(m1)); + + if (m1.rows() != 1) { + // test assertion on mismatching size -- matrix case + VERIFY_RAISES_ASSERT(m1.swap(m1.row(0))); + // test assertion on mismatching size -- xpr case + VERIFY_RAISES_ASSERT(m1.row(0).swap(m1)); + } } template