From baf9a985ece8c02d45ae151d64bdf25d3e2faeaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20S=C3=A1nchez?= Date: Thu, 10 Mar 2022 15:05:58 +0000 Subject: [PATCH] Fix swap test for size 1 inputs. --- test/swap.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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