From 437a79e1ab2606aa0d6346df0bee99347e771e01 Mon Sep 17 00:00:00 2001 From: Hauke Heibel Date: Mon, 7 Sep 2009 17:48:42 +0200 Subject: Fixed unit test and improved code reusage for resizing. --- test/conservative_resize.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/conservative_resize.cpp b/test/conservative_resize.cpp index f0d025283..b92dd5449 100644 --- a/test/conservative_resize.cpp +++ b/test/conservative_resize.cpp @@ -65,7 +65,7 @@ void run_matrix_tests() const int rows = ei_random(50,75); const int cols = ei_random(50,75); m = n = MatrixType::Random(50,50); - m.conservativeResize(rows,cols,true); + m.conservativeResizeLike(MatrixType::Zero(rows,cols)); VERIFY_IS_APPROX(m.block(0,0,n.rows(),n.cols()), n); VERIFY( rows<=50 || m.block(50,0,rows-50,cols).sum() == Scalar(0) ); VERIFY( cols<=50 || m.block(0,50,rows,cols-50).sum() == Scalar(0) ); @@ -102,7 +102,7 @@ void run_vector_tests() { const int size = ei_random(50,100); m = n = MatrixType::Random(50); - m.conservativeResize(size,true); + m.conservativeResizeLike(MatrixType::Zero(size)); VERIFY_IS_APPROX(m.segment(0,50), n); VERIFY( size<=50 || m.segment(50,size-50).sum() == Scalar(0) ); } -- cgit v1.2.3