From c5c27c5d7f4207afbea7726662f61d6ad7af97fa Mon Sep 17 00:00:00 2001
From: Tomas Oberhuber <tomas.oberhuber@fjfi.cvut.cz>
Date: Tue, 11 Feb 2020 11:11:57 +0100
Subject: [PATCH] Fixing binary sparse matrix unit tests.

---
 .../Matrices/BinarySparseMatrixTest.hpp       | 20 +++----------------
 1 file changed, 3 insertions(+), 17 deletions(-)

diff --git a/src/UnitTests/Matrices/BinarySparseMatrixTest.hpp b/src/UnitTests/Matrices/BinarySparseMatrixTest.hpp
index 8b3d8f8333..276c432ff3 100644
--- a/src/UnitTests/Matrices/BinarySparseMatrixTest.hpp
+++ b/src/UnitTests/Matrices/BinarySparseMatrixTest.hpp
@@ -1078,9 +1078,7 @@ void test_SaveAndLoad( const char* filename )
    const IndexType m_cols = 4;
 
    Matrix savedMatrix( m_rows, m_cols );
-   typename Matrix::CompressedRowLengthsVector rowLengths;
-   rowLengths.setSize( m_rows );
-   rowLengths.setValue( 3 );
+   typename Matrix::CompressedRowLengthsVector rowLengths( m_rows, 3 );
    savedMatrix.setCompressedRowLengths( rowLengths );
 
    for( IndexType i = 0; i < m_cols - 1; i++ )   // 0th row
@@ -1098,14 +1096,6 @@ void test_SaveAndLoad( const char* filename )
    ASSERT_NO_THROW( savedMatrix.save( filename ) );
 
    Matrix loadedMatrix;
-   loadedMatrix.reset();
-   loadedMatrix.setDimensions( m_rows, m_cols );
-   typename Matrix::CompressedRowLengthsVector rowLengths2;
-   rowLengths2.setSize( m_rows );
-   rowLengths2.setValue( 3 );
-   loadedMatrix.setCompressedRowLengths( rowLengths2 );
-
-
    ASSERT_NO_THROW( loadedMatrix.load( filename ) );
 
 
@@ -1172,12 +1162,8 @@ void test_Print()
    const IndexType m_rows = 5;
    const IndexType m_cols = 4;
 
-   Matrix m;
-   m.reset();
-   m.setDimensions( m_rows, m_cols );
-   typename Matrix::CompressedRowLengthsVector rowLengths;
-   rowLengths.setSize( m_rows );
-   rowLengths.setValue( 3 );
+   Matrix m( m_rows, m_cols );
+   typename Matrix::CompressedRowLengthsVector rowLengths( m_rows, 3 );
    m.setCompressedRowLengths( rowLengths );
 
    RealType value = 1;
-- 
GitLab