Commit 22fd2627 authored by Lukas Cejka's avatar Lukas Cejka Committed by Tomáš Oberhuber
Browse files

In SparseMatrixTest.h:

	Create the testGetType and its corresponding gtest.
parent 05fbae47
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -18,6 +18,28 @@ using CSR_cuda = TNL::Matrices::CSR< int, TNL::Devices::Cuda, int >;
#ifdef HAVE_GTEST 
#include <gtest/gtest.h>

template< typename Matrix >
void testGetType()
{
    Matrix<float, TNL::Devices::Cuda, int> floatCudaMatrix;
//    using CSR_host_getType = TNL::Matrices::CSR< float, TNL::Devices::Host, int>
    Matrix<float, TNL::Devices::Host, int> floatHostMatrix;
//    using CSR_cuda_getType = TNL::Matrices::CSR< float, TNL::Devices::Cuda, int>
    EXPECT_EQ( floatCudaMatrix.getType(), "Matrices::CSR< float, Cuda >");
}

TEST( SparseMatrixTest, GetTypeTest )
{
   testGetType< CSR_host >();
}

#ifdef HAVE_CUDA
TEST( SparseMatrixTest, GetTypeTest )
{
   testGetType< CSR_cuda >();
}
#endif

#endif

#include "../GtestMissingError.h"