Skip to content
Snippets Groups Projects
Commit c7d3de03 authored by Lukas Cejka's avatar Lukas Cejka
Browse files

Added test for setDimensions function. This test is correct assuming that...

Added test for setDimensions function. This test is correct assuming that getRows() and getColumns() work correctly and don't need to be tested.
parent 6802d154
No related branches found
No related tags found
1 merge request!16Matrices
......@@ -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"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment