diff options
author | Gael Guennebaud <g.gael@free.fr> | 2016-04-13 22:18:02 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2016-04-13 22:18:02 +0200 |
commit | f4e12272f15ecde2751d1be615527925b19dee0e (patch) | |
tree | 8c72ac6b559a21d44bc14bf757331e757c09eab0 /test/swap.cpp | |
parent | a95e1a273e9e194c3bbd62634c42dc2b52911f21 (diff) |
Fix corner case in unit test.
Diffstat (limited to 'test/swap.cpp')
-rw-r--r-- | test/swap.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/test/swap.cpp b/test/swap.cpp index 5d6f0e6af..f76e3624d 100644 --- a/test/swap.cpp +++ b/test/swap.cpp @@ -74,10 +74,13 @@ template<typename MatrixType> void swap(const MatrixType& m) m1 = m1_copy; m3 = m3_copy; - // 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)); + } } void test_swap() |