diff --git a/src/UnitTests/Matrices/SparseMatrixTest.h b/src/UnitTests/Matrices/SparseMatrixTest.h index dbc98da90e66ffbebee61328e58cac5c9feb5a44..f1f4bad24637b2f78c59590b961c12de0eca137a 100644 --- a/src/UnitTests/Matrices/SparseMatrixTest.h +++ b/src/UnitTests/Matrices/SparseMatrixTest.h @@ -48,6 +48,16 @@ void cuda_testGetType() EXPECT_EQ( mtrxCudaInt.getType(), TNL::String( "Matrices::CSR< int, Cuda >" ) ); } +template< typename Matrix > +void testSetDimensions() +{ + Matrix m; + m.setDimensions( 9, 8 ); + + EXPECT_EQ( m.getRows(), 9); + EXPECT_EQ( m.getColumns(), 8); +} + TEST( SparseMatrixTest, CSR_GetTypeTest_Host ) { host_testGetType< CSR_host_float, CSR_host_int >(); @@ -60,6 +70,18 @@ TEST( SparseMatrixTest, CSR_GetTypeTest_Cuda ) } #endif +TEST( SparseMatrixTest, CSR_testSetDimensions_Host ) +{ + testSetDimensions< CSR_host_int >(); +} + +#ifdef HAVE_CUDA +TEST( SparseMatrixTest, CSR_SetDimensionsTest_Cuda ) +{ + testSetDimensions< CSR_cuda_int >(); +} +#endif + #endif #include "../GtestMissingError.h"