diff options
author | Gael Guennebaud <g.gael@free.fr> | 2008-10-24 21:42:03 +0000 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2008-10-24 21:42:03 +0000 |
commit | 8ea8b481de07169706343f35f928eac845b706fe (patch) | |
tree | 9a082b32a020aebd6df50bf73de275e5e2cdaef8 /test/basicstuff.cpp | |
parent | 65abb4c52e198c7379ad50655bfaa9d4ddd20c77 (diff) |
As discussed on ML:
* remove the automatic resizing feature of operator =
* add function Matrix::set() to be used when the previous
behavior is wanted
* the default constructor of dynamic-size matrices now
creates a "null" matrix (data=0, rows = cols = 0)
instead of a 1x1 matrix
* fix UnixX typos ;)
Diffstat (limited to 'test/basicstuff.cpp')
-rw-r--r-- | test/basicstuff.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/basicstuff.cpp b/test/basicstuff.cpp index 40e999c87..75efd4d10 100644 --- a/test/basicstuff.cpp +++ b/test/basicstuff.cpp @@ -95,6 +95,20 @@ template<typename MatrixType> void basicStuff(const MatrixType& m) VERIFY_RAISES_ASSERT(m1 = (m2.block(0,0, rows-1, cols-1))); } + // test set + { + VERIFY_IS_APPROX(m3.set(m1),m1); + MatrixType m4, m5; + VERIFY_IS_APPROX(m4.set(m1),m1); + if (MatrixType::RowsAtCompileTime==Dynamic && MatrixType::ColsAtCompileTime==Dynamic) + { + MatrixType m6(rows+1,cols); + VERIFY_RAISES_ASSERT(m5 = m1); + VERIFY_RAISES_ASSERT(m3 = m5); + VERIFY_RAISES_ASSERT(m3 = m6); + } + } + // test swap m3 = m1; m1.swap(m2); |