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
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -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"